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

Thomas Guillem git at videolan.org
Mon Nov 30 09:41:07 CET 2020


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Nov 26 17:25:24 2020 +0100| [9257d8a3f4e2c6a362cba550914215b22babad84] | committer: Thomas Guillem

mmdevice: don't request gain from Open()

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().

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9257d8a3f4e2c6a362cba550914215b22babad84
---

 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 b4d84d0004..f2e1d0cc82 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;



More information about the vlc-commits mailing list