[vlc-commits] ALSA: avoid new lines in device description

Rémi Denis-Courmont git at videolan.org
Thu Apr 7 23:39:21 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Apr  8 00:38:56 2011 +0300| [148734ac5e01a552510e53aacbd6c995bcddcdc8] | committer: Rémi Denis-Courmont

ALSA: avoid new lines in device description

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

 modules/audio_output/alsa.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/modules/audio_output/alsa.c b/modules/audio_output/alsa.c
index f1c382a..ed72dc3 100644
--- a/modules/audio_output/alsa.c
+++ b/modules/audio_output/alsa.c
@@ -942,7 +942,10 @@ static void GetDevices (vlc_object_t *obj, module_config_t *item)
     {
         void *hint = hints[i];
         char *name = snd_device_name_get_hint(hint, "NAME");
-        char *desc = snd_device_name_get_hint (hint, "DESC");
+        char *desc = snd_device_name_get_hint(hint, "DESC");
+
+        for (char *lf = strchr(desc, '\n'); lf; lf = strchr(lf, '\n'))
+             *lf = ' ';
 
         if (likely(desc != NULL && name != NULL))
             msg_Dbg(obj, " %s (%s)", desc, name);



More information about the vlc-commits mailing list