Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions audio/out/ao.c
Original file line number Diff line number Diff line change
Expand Up @@ -556,22 +556,22 @@ void ao_device_list_add(struct ao_device_list *list, struct ao *ao,
struct ao_device_desc *e)
{
struct ao_device_desc c = *e;
const char *dname = ao->driver->name;
c.ao = ao->driver->name;
char buf[80];
if (!c.desc || !c.desc[0]) {
if (c.name && c.name[0]) {
c.desc = c.name;
} else if (list->num_devices) {
// Assume this is the default device.
snprintf(buf, sizeof(buf), "Default (%s)", dname);
snprintf(buf, sizeof(buf), "Default (%s)", c.ao);
c.desc = buf;
} else {
// First default device (and maybe the only one).
c.desc = "Default";
}
}
c.name = (c.name && c.name[0]) ? talloc_asprintf(list, "%s/%s", dname, c.name)
: talloc_strdup(list, dname);
c.name = (c.name && c.name[0]) ? talloc_asprintf(list, "%s/%s", c.ao, c.name)
: talloc_strdup(list, c.ao);
c.desc = talloc_strdup(list, c.desc);
MP_TARRAY_APPEND(list, list->devices, list->num_devices, c);
}
Expand Down
1 change: 1 addition & 0 deletions audio/out/ao.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ enum {
struct ao_device_desc {
const char *name; // symbolic name; will be set on ao->device
const char *desc; // verbose human readable name
const char *ao; // ao name; will be set on ao
};

struct ao_device_list {
Expand Down
1 change: 1 addition & 0 deletions player/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -1795,6 +1795,7 @@ static int get_device_entry(int item, int action, void *arg, void *ctx)
struct m_sub_property props[] = {
{"name", SUB_PROP_STR(entry->name)},
{"description", SUB_PROP_STR(entry->desc)},
{"ao", SUB_PROP_STR(entry->ao)},
{0}
};

Expand Down
3 changes: 2 additions & 1 deletion player/lua/select.lua
Original file line number Diff line number Diff line change
Expand Up @@ -344,11 +344,12 @@ mp.add_key_binding(nil, "select-audio-device", function ()
end

input.select({
prompt = "Select an audio device:",
prompt = "Select an audio device (and ao):",
items = items,
default_item = default_item,
submit = function (id)
mp.set_property("audio-device", devices[id].name)
mp.set_property("ao", devices[id].ao)
end,
})
end)
Expand Down
Loading