0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

ao_wasapi: make wait for audio thread termination infinite

The time-out was a terrible hack for marginally better behaviour when
encountering #1773, which appears to have been resolved by a previous commit.
This commit is contained in:
Kevin Mitchell 2016-02-26 15:16:56 -08:00
parent 67b7038be3
commit 183e2cda30

View File

@ -248,12 +248,11 @@ static void uninit(struct ao *ao)
if (state->hWake)
set_thread_state(ao, WASAPI_THREAD_SHUTDOWN);
// wait up to 10 seconds
if (state->hAudioThread &&
WaitForSingleObject(state->hAudioThread, 10000) == WAIT_TIMEOUT)
WaitForSingleObject(state->hAudioThread, INFINITE) != WAIT_OBJECT_0)
{
MP_ERR(ao, "Audio loop thread refuses to abort\n");
return;
MP_ERR(ao, "Unexpected return value from WaitForSingleObject "
"while waiting for audio thread to terminate\n");
}
SAFE_RELEASE(state->hInitDone, CloseHandle(state->hInitDone));