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

Rémi Denis-Courmont git at videolan.org
Thu Mar 1 10:29:01 CET 2018


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

mmdevice: do not print error message in device callback

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

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

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

 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 4a8b6ccc18..c89bfddcaa 100644
--- a/modules/audio_output/mmdevice.c
+++ b/modules/audio_output/mmdevice.c
@@ -1402,7 +1402,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;
@@ -1435,7 +1435,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