]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Don't show non-existing devices in snd_device_name_hint()
authorTakashi Iwai <tiwai@suse.de>
Fri, 7 Mar 2008 16:01:56 +0000 (17:01 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 7 Mar 2008 16:01:56 +0000 (17:01 +0100)
Suppress the non-existing devices in snd_device_name_hint().

src/control/namehint.c

index d62830bd78891a52e2110ba5e7ea0abc2a007a04..b526ad5d2e82fd9662f14b6aa53656d7c3e8a850 100644 (file)
@@ -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