From 363b7f8289fad5975e7aca1d329b2fd0ab3bea40 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 7 Mar 2008 17:01:56 +0100 Subject: [PATCH] Don't show non-existing devices in snd_device_name_hint() Suppress the non-existing devices in snd_device_name_hint(). --- src/control/namehint.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 -- 2.47.1