[vlc-commits] Make ALSA devices without description appear in Qt4 config.

Andreas Hartmetz git at videolan.org
Sun Jan 3 16:09:22 CET 2016


vlc | branch: master | Andreas Hartmetz <ahartmetz at gmail.com> | Sun Jan  3 14:33:39 2016 +0100| [a5fb9f78f3dbf087eed3744db15a3cb9301b92e0] | committer: Jean-Baptiste Kempf

Make ALSA devices without description appear in Qt4 config.

If an /etc/asound.conf or $HOME/.asoundrc creates devices, those do not have a
description (a null pointer is returned). Relatedly, redefining the "default"
device results in it being listed without a description, thus disabling the
code that adds "default" WITH a description.
Possibly fixes other problems where ALSA devices with a NULL
description are disregarded. In Qt4 config, the NULL check is in
StringListConfigControl::finish().

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a5fb9f78f3dbf087eed3744db15a3cb9301b92e0
---

 modules/audio_output/alsa.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/audio_output/alsa.c b/modules/audio_output/alsa.c
index fcb949d..a2c3436 100644
--- a/modules/audio_output/alsa.c
+++ b/modules/audio_output/alsa.c
@@ -738,9 +738,10 @@ static int EnumDevices(vlc_object_t *obj, char const *varname,
             continue;
 
         char *desc = snd_device_name_get_hint(hint, "DESC");
-        if (desc != NULL)
-            for (char *lf = strchr(desc, '\n'); lf; lf = strchr(lf, '\n'))
-                 *lf = ' ';
+        if (desc == NULL)
+            desc = xstrdup (name);
+        for (char *lf = strchr(desc, '\n'); lf; lf = strchr(lf, '\n'))
+            *lf = ' ';
         msg_Dbg (obj, "%s (%s)", (desc != NULL) ? desc : name, name);
 
         ids = xrealloc (ids, (n + 1) * sizeof (*ids));



More information about the vlc-commits mailing list