don't put both the card and the pcm name in the description of a device if one contains the other

This commit is contained in:
Lennart Poettering 2009-02-24 11:29:11 +01:00
parent ba3c7668a4
commit 03ac71bcad

View 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"); cn = pa_proplist_gets(p, "alsa.card_name");
} }
if (cn && n) if (cn && n && !strstr(cn, n) && !strstr(n, cn))
pa_proplist_setf(p, PA_PROP_DEVICE_DESCRIPTION, "%s - %s", cn, n); pa_proplist_setf(p, PA_PROP_DEVICE_DESCRIPTION, "%s, %s", cn, n);
else if (cn) else if (cn && (!n || strstr(cn, n)))
pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, cn); pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, cn);
else if (n) else if (n)
pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, n); pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, n);