[vlc-devel] [PATCH 3/3] mmdevice: reset gain when the volume is changed from outside
Thomas Guillem
thomas at gllm.fr
Mon Oct 3 17:43:53 CEST 2016
---
modules/audio_output/mmdevice.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/modules/audio_output/mmdevice.c b/modules/audio_output/mmdevice.c
index 77d8df2..1a9170a 100644
--- a/modules/audio_output/mmdevice.c
+++ b/modules/audio_output/mmdevice.c
@@ -280,6 +280,10 @@ vlc_AudioSessionEvents_OnSimpleVolumeChanged(IAudioSessionEvents *this,
msg_Dbg(aout, "simple volume changed: %f, muting %sabled", vol,
mute ? "en" : "dis");
EnterCriticalSection(&sys->lock);
+ /* If the user ask to lower the volume, there is no need to amplify
+ * anymore. */
+ if (vol < 1.0f)
+ sys->gain = 1.0f;
WakeConditionVariable(&sys->work); /* implicit state: vol & mute */
LeaveCriticalSection(&sys->lock);
(void) ctx;
--
2.9.3
More information about the vlc-devel
mailing list