mirror of
https://github.com/mpv-player/mpv
synced 2025-02-28 11:20:56 +00:00
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).
This commit is contained in:
parent
c1cb04b6a3
commit
b3e74f652b
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user