From 183e2cda309fc81158e18b52e64008a45263212e Mon Sep 17 00:00:00 2001 From: Kevin Mitchell Date: Fri, 26 Feb 2016 15:16:56 -0800 Subject: 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. --- audio/out/ao_wasapi.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'audio') diff --git a/audio/out/ao_wasapi.c b/audio/out/ao_wasapi.c index 146dd203c6..eecfded9e1 100644 --- a/audio/out/ao_wasapi.c +++ b/audio/out/ao_wasapi.c @@ -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)); -- cgit v1.2.3