summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_wasapi.c
diff options
context:
space:
mode:
authorKevin Mitchell <kevmitch@gmail.com>2016-01-04 17:43:22 -0800
committerKevin Mitchell <kevmitch@gmail.com>2016-01-05 17:47:55 -0800
commitd22d24a6d53abdeac32e13317a78c0b905769185 (patch)
tree8f347752fc8c47aa0e953290ad7e83eb009f17f0 /audio/out/ao_wasapi.c
parentfb84c6974d0026aab7e23aedd4136952b1c6ab7b (diff)
downloadmpv-d22d24a6d53abdeac32e13317a78c0b905769185.tar.bz2
mpv-d22d24a6d53abdeac32e13317a78c0b905769185.tar.xz
ao_wasapi: move device selection to main thread
In attempt to simplify the audio event thread, this can now be moved out.
Diffstat (limited to 'audio/out/ao_wasapi.c')
-rw-r--r--audio/out/ao_wasapi.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/audio/out/ao_wasapi.c b/audio/out/ao_wasapi.c
index 37f6d3b4de..9f8a3fedd7 100644
--- a/audio/out/ao_wasapi.c
+++ b/audio/out/ao_wasapi.c
@@ -273,7 +273,7 @@ static void uninit(struct ao *ao)
SAFE_RELEASE(state->hInitDone, CloseHandle(state->hInitDone));
SAFE_RELEASE(state->hWake, CloseHandle(state->hWake));
SAFE_RELEASE(state->hAudioThread,CloseHandle(state->hAudioThread));
-
+ talloc_free(state->deviceID);
CoUninitialize();
MP_DBG(ao, "Uninit wasapi done\n");
}
@@ -286,6 +286,11 @@ static int init(struct ao *ao)
struct wasapi_state *state = ao->priv;
state->log = ao->log;
+ if (!find_device(ao)) {
+ uninit(ao);
+ return -1;
+ }
+
state->hInitDone = CreateEventW(NULL, FALSE, FALSE, NULL);
state->hWake = CreateEventW(NULL, FALSE, FALSE, NULL);
if (!state->hInitDone || !state->hWake) {