summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_wasapi.c
diff options
context:
space:
mode:
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) {