[vlc-commits] MMDevice: simplify Close in WinRT mode

Jean-Baptiste Kempf git at videolan.org
Thu Nov 28 15:30:34 CET 2013


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Nov 28 14:11:47 2013 +0100| [b0d53839fe33da761935e47b9912f39e07280152] | committer: Jean-Baptiste Kempf

MMDevice: simplify Close in WinRT mode

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/audio_output/mmdevice.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/audio_output/mmdevice.c b/modules/audio_output/mmdevice.c
index aee2615..7e99107 100644
--- a/modules/audio_output/mmdevice.c
+++ b/modules/audio_output/mmdevice.c
@@ -821,23 +821,24 @@ static void Close(vlc_object_t *obj)
     audio_output_t *aout = (audio_output_t *)obj;
     aout_sys_t *sys = aout->sys;
 
+#if !VLC_WINSTORE_APP
     EnterMTA(); /* enter MTA before thread leaves MTA */
     if (sys->dev != NULL)
         CloseDevice(aout);
 
-#if !VLC_WINSTORE_APP
     IMMDeviceEnumerator_Release(sys->it);
     sys->it = NULL;
 
     SetEvent(sys->device_changed);
     vlc_join(sys->thread, NULL);
-#endif
 
     LeaveMTA();
 
-#if !VLC_WINSTORE_APP
     CloseHandle(sys->device_ready);
     CloseHandle(sys->device_changed);
+#else
+    if (sys->dev != NULL)
+        CloseDevice(aout);
 #endif
     free(sys);
 }



More information about the vlc-commits mailing list