From: Takashi Iwai Date: Fri, 7 Mar 2008 16:01:56 +0000 (+0100) Subject: Don't show non-existing devices in snd_device_name_hint() X-Git-Tag: v1.0.17rc1~17 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=363b7f8289fad5975e7aca1d329b2fd0ab3bea40;p=alsa-lib.git Don't show non-existing devices in snd_device_name_hint() Suppress the non-existing devices in snd_device_name_hint(). --- diff --git a/src/control/namehint.c b/src/control/namehint.c index d62830bd..b526ad5d 100644 --- a/src/control/namehint.c +++ b/src/control/namehint.c @@ -197,10 +197,11 @@ static char *get_dev_name(struct hint_list *list) free(str1); return res; } - } else { - return strdup(list->cardname); } - return NULL; + /* if the specified device doesn't exist, skip this entry */ + if (list->device_input >= 0 || list->device_output >= 0) + return NULL; + return strdup(list->cardname); } #ifndef DOC_HIDDEN