[vlc-commits] [Git][videolan/vlc][master] wasapi: initialize COM from the timer callback

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Thu Jul 14 08:25:54 UTC 2022



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
5a14c497 by Thomas Guillem at 2022-07-14T08:11:00+00:00
wasapi: initialize COM from the timer callback

Even if no problems were reported by the missing init.

- - - - -


1 changed file:

- modules/audio_output/wasapi.c


Changes:

=====================================
modules/audio_output/wasapi.c
=====================================
@@ -177,7 +177,14 @@ static void StartDeferredCallback(void *val)
     aout_stream_t *s = val;
     aout_stream_sys_t *sys = s->sys;
 
-    HRESULT hr = IAudioClient_Start(sys->client);
+    HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
+    /* From a timer callback, so it's impossible that COM was init before */
+    assert(SUCCEEDED(hr));
+
+    hr = IAudioClient_Start(sys->client);
+
+    CoUninitialize();
+
     atomic_store(&sys->started_state,
                  SUCCEEDED(hr) ? STARTED_STATE_OK : STARTED_STATE_ERROR);
 }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/5a14c497aff6f9834ad0bc53aaf4e2f36c990379

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/5a14c497aff6f9834ad0bc53aaf4e2f36c990379
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list