mirror of https://github.com/mpv-player/mpv
ao_wasapi: use MP_FATAL for stuff that leads to init failure
This commit is contained in:
parent
af90616ebe
commit
534571f794
|
@ -287,7 +287,7 @@ static int init(struct ao *ao)
|
||||||
state->hInitDone = CreateEventW(NULL, FALSE, FALSE, NULL);
|
state->hInitDone = CreateEventW(NULL, FALSE, FALSE, NULL);
|
||||||
state->hWake = CreateEventW(NULL, FALSE, FALSE, NULL);
|
state->hWake = CreateEventW(NULL, FALSE, FALSE, NULL);
|
||||||
if (!state->hInitDone || !state->hWake) {
|
if (!state->hInitDone || !state->hWake) {
|
||||||
MP_ERR(ao, "Error creating events\n");
|
MP_FATAL(ao, "Error creating events\n");
|
||||||
uninit(ao);
|
uninit(ao);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -298,7 +298,7 @@ static int init(struct ao *ao)
|
||||||
state->init_ret = E_FAIL;
|
state->init_ret = E_FAIL;
|
||||||
state->hAudioThread = CreateThread(NULL, 0, &AudioThread, ao, 0, NULL);
|
state->hAudioThread = CreateThread(NULL, 0, &AudioThread, ao, 0, NULL);
|
||||||
if (!state->hAudioThread) {
|
if (!state->hAudioThread) {
|
||||||
MP_ERR(ao, "Failed to create audio thread\n");
|
MP_FATAL(ao, "Failed to create audio thread\n");
|
||||||
uninit(ao);
|
uninit(ao);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -307,7 +307,7 @@ static int init(struct ao *ao)
|
||||||
SAFE_RELEASE(state->hInitDone,CloseHandle(state->hInitDone));
|
SAFE_RELEASE(state->hInitDone,CloseHandle(state->hInitDone));
|
||||||
if (FAILED(state->init_ret)) {
|
if (FAILED(state->init_ret)) {
|
||||||
if (!ao->probing)
|
if (!ao->probing)
|
||||||
MP_ERR(ao, "Received failure from audio thread\n");
|
MP_FATAL(ao, "Received failure from audio thread\n");
|
||||||
uninit(ao);
|
uninit(ao);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -481,7 +481,7 @@ static int hotplug_init(struct ao *ao)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
exit_label:
|
exit_label:
|
||||||
MP_ERR(state, "Error setting up audio hotplug: %s\n", mp_HRESULT_to_str(hr));
|
MP_FATAL(state, "Error setting up audio hotplug: %s\n", mp_HRESULT_to_str(hr));
|
||||||
hotplug_uninit(ao);
|
hotplug_uninit(ao);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -978,7 +978,7 @@ retry: ;
|
||||||
MP_DBG(ao, "Init wasapi thread done\n");
|
MP_DBG(ao, "Init wasapi thread done\n");
|
||||||
return S_OK;
|
return S_OK;
|
||||||
exit_label:
|
exit_label:
|
||||||
MP_ERR(state, "Error setting up audio thread: %s\n", mp_HRESULT_to_str(hr));
|
MP_FATAL(state, "Error setting up audio thread: %s\n", mp_HRESULT_to_str(hr));
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue