Skip to content

Commit

Permalink
ao_wasapi: make wait for audio thread termination infinite
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kevmitch committed Feb 26, 2016
1 parent 67b7038 commit 183e2cd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions audio/out/ao_wasapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

1 comment on commit 183e2cd

@kevmitch
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new commit that removes an old hack.

Please sign in to comment.