]> git.sesse.net Git - vlc/commitdiff
hotkeys: show intended rather than current mute status
authorRémi Denis-Courmont <remi@remlab.net>
Tue, 22 Oct 2013 17:14:54 +0000 (20:14 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Tue, 22 Oct 2013 17:15:23 +0000 (20:15 +0300)
modules/control/hotkeys.c

index e23156e8bb756e0a9985fca30955b6deaaf5872d..ec21bec4417c38bc60e948351bf45968b1e84577 100644 (file)
@@ -286,18 +286,24 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
             break;
         }
         case ACTIONID_VOL_MUTE:
-            if( playlist_MuteToggle( p_playlist ) == 0 )
+        {
+            int mute = playlist_MuteGet( p_playlist );
+            if( mute < 0 )
+                break;
+            mute = !mute;
+            if( playlist_MuteSet( p_playlist, mute ) )
+                break;
+
+            float vol = playlist_VolumeGet( p_playlist );
+            if( mute || vol == 0.f )
             {
-                float vol = playlist_VolumeGet( p_playlist );
-                if( playlist_MuteGet( p_playlist ) > 0 || vol == 0.f )
-                {
-                    ClearChannels( p_intf, p_vout );
-                    DisplayIcon( p_vout, OSD_MUTE_ICON );
-                }
-                else
-                    DisplayVolume( p_intf, p_vout, vol );
+                ClearChannels( p_intf, p_vout );
+                DisplayIcon( p_vout, OSD_MUTE_ICON );
             }
+            else
+                DisplayVolume( p_intf, p_vout, vol );
             break;
+        }
 
         case ACTIONID_AUDIODEVICE_CYCLE:
         {