mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user