1
mirror of https://github.com/mpv-player/mpv synced 2024-10-06 14:54:02 +02:00

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.
This commit is contained in:
Kevin Mitchell 2016-01-21 21:24:49 -08:00
parent 2df448b1f3
commit ff7884e635

View File

@ -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);