[vlc-commits] mmdevice: report new volume after its modification (if any)

Thomas Guillem git at videolan.org
Wed Feb 28 13:55:46 CET 2018


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Feb 27 12:16:29 2018 +0100| [e065ea97fb0710b682db72edb3a661b07b8c669e] | committer: Thomas Guillem

mmdevice: report new volume after its modification (if any)

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

 modules/audio_output/mmdevice.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/modules/audio_output/mmdevice.c b/modules/audio_output/mmdevice.c
index 3d96e3b4d2..0fcf4ea930 100644
--- a/modules/audio_output/mmdevice.c
+++ b/modules/audio_output/mmdevice.c
@@ -971,12 +971,6 @@ static HRESULT MMSession(audio_output_t *aout, IMMDeviceEnumerator *it)
         {
             float level;
 
-            hr = ISimpleAudioVolume_GetMasterVolume(volume, &level);
-            if (SUCCEEDED(hr))
-                aout_VolumeReport(aout, cbrtf(level * sys->gain));
-            else
-                msg_Err(aout, "cannot get master volume (error 0x%lx)", hr);
-
             level = sys->requested_volume;
             if (level >= 0.f)
             {
@@ -987,6 +981,12 @@ static HRESULT MMSession(audio_output_t *aout, IMMDeviceEnumerator *it)
             }
             sys->requested_volume = -1.f;
 
+            hr = ISimpleAudioVolume_GetMasterVolume(volume, &level);
+            if (SUCCEEDED(hr))
+                aout_VolumeReport(aout, cbrtf(level * sys->gain));
+            else
+                msg_Err(aout, "cannot get master volume (error 0x%lx)", hr);
+
             BOOL mute;
 
             hr = ISimpleAudioVolume_GetMute(volume, &mute);



More information about the vlc-commits mailing list