summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorKevin Mitchell <kevmitch@gmail.com>2014-11-17 23:46:38 -0800
committerKevin Mitchell <kevmitch@gmail.com>2014-11-17 23:46:38 -0800
commit22bf0a78df83424fd6de3b7f46a9af258ec8e424 (patch)
tree5579444e629baa3ee1d78f8f411d1dd940a73336 /audio
parent20d42b3475d68cd98f49e9008b3f6a9d4d334e0f (diff)
downloadmpv-22bf0a78df83424fd6de3b7f46a9af258ec8e424.tar.bz2
mpv-22bf0a78df83424fd6de3b7f46a9af258ec8e424.tar.xz
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.
Diffstat (limited to 'audio')
-rw-r--r--audio/out/ao_wasapi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/audio/out/ao_wasapi.c b/audio/out/ao_wasapi.c
index 4f982f7a7b..074a6b32b2 100644
--- a/audio/out/ao_wasapi.c
+++ b/audio/out/ao_wasapi.c
@@ -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);