[vlc-commits] auhal: do not change volume when muted

David Fuhrmann git at videolan.org
Wed Oct 16 22:44:41 CEST 2013


vlc/vlc-2.1 | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Wed Oct 16 22:36:44 2013 +0200| [637a1e26156af01c2465d1f52b5527811e5e8d6e] | committer: David Fuhrmann

auhal: do not change volume when muted
(cherry picked from commit fce950fc907a5fdab50b866900d7123d47c37357)

Signed-off-by: David Fuhrmann <david.fuhrmann at googlemail.com>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=637a1e26156af01c2465d1f52b5527811e5e8d6e
---

 modules/audio_output/auhal.c |   16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/modules/audio_output/auhal.c b/modules/audio_output/auhal.c
index 5244a3f..1ce1d9f 100644
--- a/modules/audio_output/auhal.c
+++ b/modules/audio_output/auhal.c
@@ -1278,7 +1278,7 @@ static int SwitchAudioDevice(audio_output_t *p_aout, const char *name)
 static int VolumeSet(audio_output_t * p_aout, float volume)
 {
     struct aout_sys_t *p_sys = p_aout->sys;
-    OSStatus ostatus;
+    OSStatus ostatus = 0;
 
     if(p_sys->b_digital)
         return VLC_EGENERIC;
@@ -1287,12 +1287,14 @@ static int VolumeSet(audio_output_t * p_aout, float volume)
     aout_VolumeReport(p_aout, volume);
 
     /* Set volume for output unit */
-    ostatus = AudioUnitSetParameter(p_sys->au_unit,
-                                    kHALOutputParam_Volume,
-                                    kAudioUnitScope_Global,
-                                    0,
-                                    volume * volume * volume,
-                                    0);
+    if(!p_sys->b_mute) {
+        ostatus = AudioUnitSetParameter(p_sys->au_unit,
+                                        kHALOutputParam_Volume,
+                                        kAudioUnitScope_Global,
+                                        0,
+                                        volume * volume * volume,
+                                        0);
+    }
 
     if (var_InheritBool(p_aout, "volume-save"))
         config_PutInt(p_aout, "auhal-volume", lroundf(volume * AOUT_VOLUME_DEFAULT));



More information about the vlc-commits mailing list