]> git.alsa-project.org Git - alsa-lib.git/commitdiff
namehint: add missing list->card initialization
authorJaroslav Kysela <perex@perex.cz>
Tue, 3 Nov 2009 15:36:55 +0000 (16:36 +0100)
committerJaroslav Kysela <perex@perex.cz>
Tue, 3 Nov 2009 15:42:44 +0000 (16:42 +0100)
list->card is wrongly assumed to be initialized, but the previous
initialization is within a conditional that is false when only
card-independent devices are found.  (This is the case when searching
for mixers on my system; the end result is that the "pulse" mixer is
listed three times.)

Signed-off-by: John Lindgren <john.lindgren@tds.net>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/control/namehint.c

index a134ed7e47349564a4a8c3659be6d7236f87d34e..1d3f4be9e598f00c8604e848e5801c74c2f8bbb8 100644 (file)
@@ -453,6 +453,7 @@ static int add_card(struct hint_list *list, int card)
                if (err == -EXDEV)
                        continue;
                if (err < 0) {
+                       list->card = card;
                        list->device = -1;
                        err = try_config(list, list->siface, str);
                }