Commit fce950fc authored by David Fuhrmann's avatar David Fuhrmann

auhal: do not change volume when muted

parent 216b6ea6
...@@ -1275,7 +1275,7 @@ static int SwitchAudioDevice(audio_output_t *p_aout, const char *name) ...@@ -1275,7 +1275,7 @@ static int SwitchAudioDevice(audio_output_t *p_aout, const char *name)
static int VolumeSet(audio_output_t * p_aout, float volume) static int VolumeSet(audio_output_t * p_aout, float volume)
{ {
struct aout_sys_t *p_sys = p_aout->sys; struct aout_sys_t *p_sys = p_aout->sys;
OSStatus ostatus; OSStatus ostatus = 0;
if(p_sys->b_digital) if(p_sys->b_digital)
return VLC_EGENERIC; return VLC_EGENERIC;
...@@ -1284,12 +1284,14 @@ static int VolumeSet(audio_output_t * p_aout, float volume) ...@@ -1284,12 +1284,14 @@ static int VolumeSet(audio_output_t * p_aout, float volume)
aout_VolumeReport(p_aout, volume); aout_VolumeReport(p_aout, volume);
/* Set volume for output unit */ /* Set volume for output unit */
ostatus = AudioUnitSetParameter(p_sys->au_unit, if(!p_sys->b_mute) {
kHALOutputParam_Volume, ostatus = AudioUnitSetParameter(p_sys->au_unit,
kAudioUnitScope_Global, kHALOutputParam_Volume,
0, kAudioUnitScope_Global,
volume * volume * volume, 0,
0); volume * volume * volume,
0);
}
if (var_InheritBool(p_aout, "volume-save")) if (var_InheritBool(p_aout, "volume-save"))
config_PutInt(p_aout, "auhal-volume", lroundf(volume * AOUT_VOLUME_DEFAULT)); config_PutInt(p_aout, "auhal-volume", lroundf(volume * AOUT_VOLUME_DEFAULT));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment