summaryrefslogtreecommitdiffstats
path: root/audio/out/ao.h
diff options
context:
space:
mode:
authorThomas Weißschuh <thomas@t-8ch.de>2022-12-31 03:46:44 +0000
committerPhilip Langdale <github.philipl@overt.org>2023-01-25 15:49:21 -0800
commit870512eb84a5b8bc4d4fdd794eb11bb3598e234b (patch)
treec68417de22549377028006b72b51657535ecd3b7 /audio/out/ao.h
parent5510d9f6632c009c398ce48a4d5a89c7f95efc96 (diff)
downloadmpv-870512eb84a5b8bc4d4fdd794eb11bb3598e234b.tar.bz2
mpv-870512eb84a5b8bc4d4fdd794eb11bb3598e234b.tar.xz
audio: simplify implementation of property ao-volume
ao-volume is represented in the code with a `struct ao_control_vol_t` which contains volumes for two channels, left and right. However the code implementing this property in command.c never treats these values individually. They are always averaged together. On the other hand the code in the AOs handling these values also has to handle the case where *not* exactly two channels are handled. So let's remove the `struct ao_control_vol_t` and replace it with a simple float. This makes the semantics clear to AO authors and allows us to drop some code from the AOs and command.c.
Diffstat (limited to 'audio/out/ao.h')
-rw-r--r--audio/out/ao.h8
1 files changed, 1 insertions, 7 deletions
diff --git a/audio/out/ao.h b/audio/out/ao.h
index 1bca124599..0ff4902021 100644
--- a/audio/out/ao.h
+++ b/audio/out/ao.h
@@ -26,8 +26,7 @@
#include "audio/chmap_sel.h"
enum aocontrol {
- // _VOLUME commands take struct ao_control_vol pointer for input/output.
- // If there's only one volume, SET should use average of left/right.
+ // _VOLUME commands take a pointer to float for input/output.
AOCONTROL_GET_VOLUME,
AOCONTROL_SET_VOLUME,
// _MUTE commands take a pointer to bool
@@ -61,11 +60,6 @@ enum {
AO_INIT_EXCLUSIVE = 1 << 3,
};
-typedef struct ao_control_vol {
- float left;
- float right;
-} ao_control_vol_t;
-
enum aocontrol_media_role {
AOCONTROL_MEDIA_ROLE_MUSIC,
AOCONTROL_MEDIA_ROLE_MOVIE,