summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_wasapi.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-06-27 14:45:30 +0200
committerwm4 <wm4@nowhere>2017-06-29 10:38:05 +0200
commit3e9075787fba1455f0c754c5387c954e1eaa0973 (patch)
treeaee95f543f17ec6001749c7ab6391299deb8d066 /audio/out/ao_wasapi.c
parent4637b029cdd168d4196f5ab69fa5f91556ee5d11 (diff)
downloadmpv-3e9075787fba1455f0c754c5387c954e1eaa0973.tar.bz2
mpv-3e9075787fba1455f0c754c5387c954e1eaa0973.tar.xz
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.
Diffstat (limited to 'audio/out/ao_wasapi.c')
-rw-r--r--audio/out/ao_wasapi.c5
1 files changed, 4 insertions, 1 deletions
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);