summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Mitchell <kevmitch@gmail.com>2016-05-31 21:39:23 -0700
committerKevin Mitchell <kevmitch@gmail.com>2016-06-05 16:31:03 -0700
commitb3e74f652ba5edd6f7d78cb17ea35395bf6c4a33 (patch)
tree694927183aa08a0571577cbcb27f2f70aea5dd9e
parentc1cb04b6a3f4fef43bf69b43b5cf7a1e770f3839 (diff)
downloadmpv-b3e74f652ba5edd6f7d78cb17ea35395bf6c4a33.tar.bz2
mpv-b3e74f652ba5edd6f7d78cb17ea35395bf6c4a33.tar.xz
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).
-rw-r--r--audio/out/ao_wasapi.c4
1 files 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);