diff options
author | Kevin Mitchell <kevmitch@gmail.com> | 2016-01-21 21:24:49 -0800 |
---|---|---|
committer | Kevin Mitchell <kevmitch@gmail.com> | 2016-01-22 03:21:21 -0800 |
commit | ff7884e635ca402e7ca8cd1ea230fb6792b81a65 (patch) | |
tree | c33f0ae2c4471db51fca7379027f9aaa40d4342b /audio | |
parent | 2df448b1f383ebb7d29bf64a1cfb827eb1fff70b (diff) | |
download | mpv-ff7884e635ca402e7ca8cd1ea230fb6792b81a65.tar.bz2 mpv-ff7884e635ca402e7ca8cd1ea230fb6792b81a65.tar.xz |
ao_wasapi: exit earlier if there are zero playback devices found
Previously, if the enumerator found no devices, attempting to get the default
device with IMMDeviceEnumerator::GetDefaultAudioEndpoint would result in the
cryptic (and undocumented) E_PROP_ID_UNSUPPORTED. This way, the user is given a
better indication of what exactly is wrong and isolates any other possible
triggers for this error.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/out/ao_wasapi_utils.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/audio/out/ao_wasapi_utils.c b/audio/out/ao_wasapi_utils.c index c5e1eab455..2768104cb4 100644 --- a/audio/out/ao_wasapi_utils.c +++ b/audio/out/ao_wasapi_utils.c @@ -873,6 +873,11 @@ LPWSTR find_deviceID(struct ao *ao) if (!enumerator) goto exit_label; + if (!enumerator->count) { + MP_ERR(ao, "There are no playback devices available\n"); + goto exit_label; + } + if (!device.len) { MP_VERBOSE(ao, "No device specified. Selecting default.\n"); d = default_device_desc(enumerator); |