[vlc-commits] mmdevice: do not print error message in device callback

Rémi Denis-Courmont git at videolan.org
Wed Feb 28 20:02:37 CET 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Feb 28 20:44:26 2018 +0200| [ba9a9a62b9624bd30c6467c013909b2878087d36] | committer: Rémi Denis-Courmont

mmdevice: do not print error message in device callback

CoInitializeEx() is expected to fail here (Qt runs in STA).

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

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

diff --git a/modules/audio_output/mmdevice.c b/modules/audio_output/mmdevice.c
index 5d0a339141..fb53afbc24 100644
--- a/modules/audio_output/mmdevice.c
+++ b/modules/audio_output/mmdevice.c
@@ -1398,7 +1398,7 @@ static int ReloadAudioDevices(vlc_object_t *this, char const *name,
 {
     (void) name;
 
-    bool in_mta = TryEnterMTA(this) == 0;
+    bool in_mta = SUCCEEDED(CoInitializeEx(NULL, COINIT_MULTITHREADED));
 
     struct mm_list list = { .count = 0 };
     void *it;
@@ -1431,7 +1431,7 @@ static int ReloadAudioDevices(vlc_object_t *this, char const *name,
 error:
     IMMDeviceEnumerator_Release((IMMDeviceEnumerator *)it);
     if (in_mta)
-        LeaveMTA();
+        CoUninitialize();
 
     if (list.count > 0)
     {



More information about the vlc-commits mailing list