From b0d53839fe33da761935e47b9912f39e07280152 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Kempf Date: Thu, 28 Nov 2013 14:11:47 +0100 Subject: [PATCH] MMDevice: simplify Close in WinRT mode Signed-off-by: Jean-Baptiste Kempf --- 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 aee2615013..7e99107f5d 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); } -- 2.39.2