mirror of
https://github.com/mpv-player/mpv
synced 2024-12-23 23:32:26 +00:00
ao/wasapi: Don't free stuff the thread may still be using on timeout
In the unlikely event of a timeout waiting for the audio thread to return, don't free stuff that it may still be using.
This commit is contained in:
parent
20d42b3475
commit
22bf0a78df
@ -175,8 +175,10 @@ static void uninit(struct ao *ao)
|
||||
wasapi_release_proxies(state);
|
||||
SetEvent(state->hUninit);
|
||||
/* wait up to 10 seconds */
|
||||
if (WaitForSingleObject(state->threadLoop, 10000) == WAIT_TIMEOUT)
|
||||
if (WaitForSingleObject(state->threadLoop, 10000) == WAIT_TIMEOUT){
|
||||
MP_ERR(ao, "Audio loop thread refuses to abort");
|
||||
return;
|
||||
}
|
||||
if (state->VistaBlob.hAvrt)
|
||||
FreeLibrary(state->VistaBlob.hAvrt);
|
||||
closehandles(ao);
|
||||
|
Loading…
Reference in New Issue
Block a user