mirror of https://github.com/mpv-player/mpv
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:
parent
762623cdef
commit
d4aaf29a05
|
@ -390,6 +390,7 @@ static int hotplug_init(struct ao *ao)
|
||||||
{
|
{
|
||||||
MP_DBG(ao, "Hotplug init\n");
|
MP_DBG(ao, "Hotplug init\n");
|
||||||
struct wasapi_state *state = ao->priv;
|
struct wasapi_state *state = ao->priv;
|
||||||
|
state->log = ao->log;
|
||||||
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
|
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
|
||||||
HRESULT hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL,
|
HRESULT hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL,
|
||||||
&IID_IMMDeviceEnumerator, (void **)&state->pEnumerator);
|
&IID_IMMDeviceEnumerator, (void **)&state->pEnumerator);
|
||||||
|
|
Loading…
Reference in New Issue