summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-10-13 16:42:44 +0200
committerwm4 <wm4@nowhere>2014-10-13 16:42:44 +0200
commit2e52cc8f2e58bd261586e991adbd0907e4d9ab3d (patch)
treef736da60d2504b810664043adf672f69ca6591f3 /audio
parent057384baa6c624f072cb856cb599f03e043fa2c5 (diff)
downloadmpv-2e52cc8f2e58bd261586e991adbd0907e4d9ab3d.tar.bz2
mpv-2e52cc8f2e58bd261586e991adbd0907e4d9ab3d.tar.xz
audio/out: add "auto" pseudo-device
Also, don't set an empty string for the fallback device if an AO doesn't list any devices.
Diffstat (limited to 'audio')
-rw-r--r--audio/out/ao.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/audio/out/ao.c b/audio/out/ao.c
index 67691b5f4d..0b722eb57a 100644
--- a/audio/out/ao.c
+++ b/audio/out/ao.c
@@ -402,6 +402,8 @@ bool ao_untimed(struct ao *ao)
struct ao_device_list *ao_get_device_list(struct mpv_global *global)
{
struct ao_device_list *list = talloc_zero(NULL, struct ao_device_list);
+ MP_TARRAY_APPEND(list, list->devices, list->num_devices,
+ (struct ao_device_desc){"auto", "Autoselect device"});
for (int n = 0; audio_out_drivers[n]; n++) {
const struct ao_driver *d = audio_out_drivers[n];
if (d->encode)
@@ -414,7 +416,7 @@ struct ao_device_list *ao_get_device_list(struct mpv_global *global)
d->list_devs(ao, list);
// Add at least a default entry
if (list->num_devices == num)
- ao_device_list_add(list, ao, &(struct ao_device_desc){"", ""});
+ ao_device_list_add(list, ao, &(struct ao_device_desc){"", "Default"});
talloc_free(ao);
}
return list;