summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@mplayer2.org>2012-01-17 07:58:57 +0100
committerwm4 <wm4@mplayer2.org>2012-01-18 04:21:46 +0100
commitf7c2ecebccc4b3c5d6299aee5b8f4d382fa78987 (patch)
tree76b4eb005ddca64d23be781e09b70f8107cdea9e
parent1d60badc3d4514da49499d177cb7b8b844839086 (diff)
downloadmpv-f7c2ecebccc4b3c5d6299aee5b8f4d382fa78987.tar.bz2
mpv-f7c2ecebccc4b3c5d6299aee5b8f4d382fa78987.tar.xz
ao_coreaudio: fix partial volume control
If digital pass-through is used, this supported setting the volume (just mute, actually), but not getting the volume. This will probably lead to a stuck mute state in the mplayer frontend. Make the code respond to volume queries even if digital pass-through is used. Ideally, ao_coreaudio should implement full mute control, but I can't even test on OSX.
-rw-r--r--libao2/ao_coreaudio.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libao2/ao_coreaudio.c b/libao2/ao_coreaudio.c
index 50e943e9ac..d1a93c85e2 100644
--- a/libao2/ao_coreaudio.c
+++ b/libao2/ao_coreaudio.c
@@ -169,7 +169,11 @@ Float32 vol;
control_vol = (ao_control_vol_t*)arg;
if (ao->b_digital) {
// Digital output has no volume adjust.
- return CONTROL_FALSE;
+ int vol = ao->b_muted ? 0 : 100;
+ *control_vol = (ao_control_vol_t) {
+ .left = vol, .right = vol,
+ };
+ return CONTROL_TRUE;
}
err = AudioUnitGetParameter(ao->theOutputUnit, kHALOutputParam_Volume, kAudioUnitScope_Global, 0, &vol);