]> code.delx.au - pulseaudio/commitdiff
don't put both the card and the pcm name in the description of a device if one contai...
authorLennart Poettering <lennart@poettering.net>
Tue, 24 Feb 2009 10:29:11 +0000 (11:29 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 24 Feb 2009 10:29:11 +0000 (11:29 +0100)
src/modules/alsa/alsa-util.c

index ec20d1dd45fbb44bebddf11dd09ac6d1ba686627..6740c06927f99ef34c85eb0c9de5fa3b882d24ec 100644 (file)
@@ -1448,9 +1448,9 @@ void pa_alsa_init_proplist_pcm_info(pa_core *c, pa_proplist *p, snd_pcm_info_t *
         cn = pa_proplist_gets(p, "alsa.card_name");
     }
 
-    if (cn && n)
-        pa_proplist_setf(p, PA_PROP_DEVICE_DESCRIPTION, "%s - %s", cn, n);
-    else if (cn)
+    if (cn && n && !strstr(cn, n) && !strstr(n, cn))
+        pa_proplist_setf(p, PA_PROP_DEVICE_DESCRIPTION, "%s, %s", cn, n);
+    else if (cn && (!n || strstr(cn, n)))
         pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, cn);
     else if (n)
         pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, n);