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

Thomas Guillem git at videolan.org
Thu Mar 1 10:28:55 CET 2018


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

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

(cherry picked from commit e065ea97fb0710b682db72edb3a661b07b8c669e)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>

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

 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 ef33563eaf..7b57ad4957 100644
--- a/modules/audio_output/mmdevice.c
+++ b/modules/audio_output/mmdevice.c
@@ -977,12 +977,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)
             {
@@ -993,6 +987,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