1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-23 23:32:26 +00:00

ao_wasapi: fix crash on hotplug init error

On init error, the mp_msg macros are actually called. They could cause
a crash because state->log was NULL.
This commit is contained in:
wm4 2015-06-17 13:42:31 +02:00
parent 762623cdef
commit d4aaf29a05

View File

@ -390,6 +390,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);
HRESULT hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL,
&IID_IMMDeviceEnumerator, (void **)&state->pEnumerator);