From 3e9075787fba1455f0c754c5387c954e1eaa0973 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 27 Jun 2017 14:45:30 +0200 Subject: ao_wasapi: UWP wrapper hack support UWP does not support the whole IMMDevice API. Instead, you need to use a new API (available starting from Windows 8), which is in addition not in MinGW, and extremely unpleasant to use. The wasapiuwp2.dll wrapper is a small custom MSVC DLL, which does this instead, and returns a normal IAudioClient. Before this, ao_wasapi did not initialize on UWP. --- audio/out/ao_wasapi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'audio/out/ao_wasapi.c') diff --git a/audio/out/ao_wasapi.c b/audio/out/ao_wasapi.c index 3ddb9a113e..1337717f7b 100644 --- a/audio/out/ao_wasapi.c +++ b/audio/out/ao_wasapi.c @@ -279,13 +279,16 @@ static int init(struct ao *ao) state->opt_exclusive |= ao->init_flags & AO_INIT_EXCLUSIVE; +#if !HAVE_UWP state->deviceID = wasapi_find_deviceID(ao); if (!state->deviceID) { uninit(ao); return -1; } +#endif - wasapi_change_init(ao, false); + if (state->deviceID) + wasapi_change_init(ao, false); state->hInitDone = CreateEventW(NULL, FALSE, FALSE, NULL); state->hWake = CreateEventW(NULL, FALSE, FALSE, NULL); -- cgit v1.2.3