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

Andreas Hartmetz git at videolan.org
Mon Jan 4 16:52:31 CET 2016


vlc/vlc-2.2 | branch: master | Andreas Hartmetz <ahartmetz at gmail.com> | Sun Jan  3 14:33:39 2016 +0100| [40e58b57fa46a2d611f00395da500f9f1b88e388] | 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>
(cherry picked from commit a5fb9f78f3dbf087eed3744db15a3cb9301b92e0)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 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 2d1f99e..5ec6ea8 100644
--- a/modules/audio_output/alsa.c
+++ b/modules/audio_output/alsa.c
@@ -720,9 +720,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