From 03ac71bcad97f013f1fc7b5ec65f642be437d65b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 24 Feb 2009 11:29:11 +0100 Subject: don't put both the card and the pcm name in the description of a device if one contains the other --- src/modules/alsa/alsa-util.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c index ec20d1dd..6740c069 100644 --- a/src/modules/alsa/alsa-util.c +++ b/src/modules/alsa/alsa-util.c @@ -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); -- cgit