[vlc-devel] [PATCH] mmdevice: don't request gain from Open()

Thomas Guillem thomas at gllm.fr
Thu Nov 26 17:27:47 CET 2020


If "--volume-save" == false, then the volume is set from Open(),
therefore a gain is requested causing the vlc_mutex_assert() in
aout_GainNotify().

The gain should be notified from any aout callbacks, but not from the
Open().
---
 modules/audio_output/mmdevice.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/modules/audio_output/mmdevice.c b/modules/audio_output/mmdevice.c
index b4d84d0004c..f2e1d0cc82b 100644
--- a/modules/audio_output/mmdevice.c
+++ b/modules/audio_output/mmdevice.c
@@ -185,8 +185,6 @@ static int VolumeSetLocked(audio_output_t *aout, float vol)
         vol = 1.f;
     }
 
-    aout_GainRequest(aout, gain);
-
     sys->gain = gain;
     sys->requested_volume = vol;
     return 0;
@@ -198,6 +196,7 @@ static int VolumeSet(audio_output_t *aout, float vol)
 
     EnterCriticalSection(&sys->lock);
     int ret = VolumeSetLocked(aout, vol);
+    aout_GainRequest(aout, sys->gain);
     WakeConditionVariable(&sys->work);
     LeaveCriticalSection(&sys->lock);
     return ret;
-- 
2.28.0



More information about the vlc-devel mailing list