From 84513ba58bcbcf6dfb17eb1ae6b7d2e6a1d7bb4b Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 14 Nov 2016 13:33:53 +0100 Subject: audio: avoid returning audio-device-list entries without description Use the device name as fallback. This is ugly, but still better than skipping the description entirely. This can be an issue on ALSA, where the API can return entries without proper description. --- audio/out/ao.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'audio/out') diff --git a/audio/out/ao.c b/audio/out/ao.c index e1a3eda9dd..9846869f2c 100644 --- a/audio/out/ao.c +++ b/audio/out/ao.c @@ -599,6 +599,8 @@ void ao_device_list_add(struct ao_device_list *list, struct ao *ao, { struct ao_device_desc c = *e; const char *dname = ao->driver->name; + if ((!c.desc || !c.desc[0]) && c.name) + c.desc = c.name; c.name = c.name[0] ? talloc_asprintf(list, "%s/%s", dname, c.name) : talloc_strdup(list, dname); c.desc = talloc_strdup(list, c.desc); -- cgit v1.2.3