From b3e74f652ba5edd6f7d78cb17ea35395bf6c4a33 Mon Sep 17 00:00:00 2001 From: Kevin Mitchell Date: Tue, 31 May 2016 21:39:23 -0700 Subject: ao_wasapi: initialize COM in main thread with MTA Since the main thread is shared by other things in the player, using STA (single threaded aparement) may have caused problems. Instead initialize in MTA (multithreaded apartment). --- audio/out/ao_wasapi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/audio/out/ao_wasapi.c b/audio/out/ao_wasapi.c index eecfded9e1..ae6bd3d9dc 100644 --- a/audio/out/ao_wasapi.c +++ b/audio/out/ao_wasapi.c @@ -270,7 +270,7 @@ static void uninit(struct ao *ao) static int init(struct ao *ao) { MP_DBG(ao, "Init wasapi\n"); - CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + CoInitializeEx(NULL, COINIT_MULTITHREADED); struct wasapi_state *state = ao->priv; state->log = ao->log; @@ -469,7 +469,7 @@ static int hotplug_init(struct ao *ao) MP_DBG(ao, "Hotplug init\n"); struct wasapi_state *state = ao->priv; state->log = ao->log; - CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + CoInitializeEx(NULL, COINIT_MULTITHREADED); HRESULT hr = wasapi_change_init(ao, true); EXIT_ON_ERROR(hr); -- cgit v1.2.3