[vlc-commits] mmdevice: initialize mute & volume (fixes #7203)

Rémi Denis-Courmont git at videolan.org
Fri Dec 7 17:26:20 CET 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Dec  7 18:24:41 2012 +0200| [db828374ff43c749b719a880b648f76e8be38aa9] | committer: Rémi Denis-Courmont

mmdevice: initialize mute & volume (fixes #7203)

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

 modules/audio_output/mmdevice.c |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/modules/audio_output/mmdevice.c b/modules/audio_output/mmdevice.c
index b4142a8..4a0db0e 100644
--- a/modules/audio_output/mmdevice.c
+++ b/modules/audio_output/mmdevice.c
@@ -504,6 +504,24 @@ static void MMSession(audio_output_t *aout, aout_sys_t *sys)
                                                          &sys->session_events);
     }
 
+    if (sys->volume != NULL)
+    {   /* Get current values (_after_ changes notification registration) */
+        BOOL mute;
+        float level;
+
+        hr = ISimpleAudioVolume_GetMute(sys->volume, &mute);
+        if (FAILED(hr))
+            msg_Err(aout, "cannot get mute (error 0x%lx)", hr);
+        else
+            aout_MuteReport(aout, mute != FALSE);
+
+        hr = ISimpleAudioVolume_GetMasterVolume(sys->volume, &level);
+        if (FAILED(hr))
+            msg_Err(aout, "cannot get mute (error 0x%lx)", hr);
+        else
+            aout_VolumeReport(aout, level);
+    }
+
     SetEvent(sys->device_ready);
     /* Wait until device change or exit */
     WaitForSingleObject(sys->device_changed, INFINITE);



More information about the vlc-commits mailing list