Skip to content

Commit 183e2cd

Browse files
committed
ao_wasapi: make wait for audio thread termination infinite
The time-out was a terrible hack for marginally better behaviour when encountering mpv-player#1773, which appears to have been resolved by a previous commit.
1 parent 67b7038 commit 183e2cd

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

audio/out/ao_wasapi.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,11 @@ static void uninit(struct ao *ao)
248248
if (state->hWake)
249249
set_thread_state(ao, WASAPI_THREAD_SHUTDOWN);
250250

251-
// wait up to 10 seconds
252251
if (state->hAudioThread &&
253-
WaitForSingleObject(state->hAudioThread, 10000) == WAIT_TIMEOUT)
252+
WaitForSingleObject(state->hAudioThread, INFINITE) != WAIT_OBJECT_0)
254253
{
255-
MP_ERR(ao, "Audio loop thread refuses to abort\n");
256-
return;
254+
MP_ERR(ao, "Unexpected return value from WaitForSingleObject "
255+
"while waiting for audio thread to terminate\n");
257256
}
258257

259258
SAFE_RELEASE(state->hInitDone, CloseHandle(state->hInitDone));

0 commit comments

Comments
 (0)