[vlc-devel] [PATCH] audio_output/mmdevice: report the mute status after it is set

Steve Lhomme robux4 at ycbcr.xyz
Tue Nov 24 09:30:10 CET 2020


---
 modules/audio_output/mmdevice.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/audio_output/mmdevice.c b/modules/audio_output/mmdevice.c
index 55d0fbb57d6..b4d84d0004c 100644
--- a/modules/audio_output/mmdevice.c
+++ b/modules/audio_output/mmdevice.c
@@ -988,9 +988,7 @@ static HRESULT MMSession(audio_output_t *aout, IMMDeviceEnumerator *it)
             BOOL mute;
 
             hr = ISimpleAudioVolume_GetMute(volume, &mute);
-            if (SUCCEEDED(hr))
-                aout_MuteReport(aout, mute != FALSE);
-            else
+            if (FAILED(hr))
                 msg_Err(aout, "cannot get mute (error 0x%lX)", hr);
 
             if (sys->requested_mute >= 0)
@@ -1002,6 +1000,9 @@ static HRESULT MMSession(audio_output_t *aout, IMMDeviceEnumerator *it)
                     msg_Err(aout, "cannot set mute (error 0x%lX)", hr);
             }
             sys->requested_mute = -1;
+
+            if (SUCCEEDED(hr))
+                aout_MuteReport(aout, mute != FALSE);
         }
 
         SleepConditionVariableCS(&sys->work, &sys->lock, INFINITE);
-- 
2.26.2



More information about the vlc-devel mailing list