mirror of https://github.com/mpv-player/mpv
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.
This commit is contained in:
parent
fc8db0ca88
commit
086d0381f0
|
@ -169,7 +169,11 @@ Float32 vol;
|
||||||
control_vol = (ao_control_vol_t*)arg;
|
control_vol = (ao_control_vol_t*)arg;
|
||||||
if (ao->b_digital) {
|
if (ao->b_digital) {
|
||||||
// Digital output has no volume adjust.
|
// 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);
|
err = AudioUnitGetParameter(ao->theOutputUnit, kHALOutputParam_Volume, kAudioUnitScope_Global, 0, &vol);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue