audio: don't add default entry to audio-device-list if AO support listing

In such cases there isn't really a reason to do so, and using such an
entry would probably fail anyway.

Also convenient for the following commit.
This commit is contained in:
wm4 2016-06-29 17:38:57 +02:00
parent 9ca1592f3f
commit deb1c3c7a8
1 changed files with 2 additions and 3 deletions

View File

@ -490,10 +490,9 @@ struct ao_hotplug *ao_hotplug_create(struct mpv_global *global,
static void get_devices(struct ao *ao, struct ao_device_list *list)
{
int num = list->num_devices;
if (ao->driver->list_devs)
if (ao->driver->list_devs) {
ao->driver->list_devs(ao, list);
// Add at least a default entry
if (list->num_devices == num) {
} else {
char name[80] = "Default";
if (num > 1)
mp_snprintf_cat(name, sizeof(name), " (%s)", ao->driver->name);