mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-09-19 17:49:59 +02:00
alsactl: fix the nested iteration
There may be nested iterations for hw: card names.
Handle this card name in snd_card_iterator_sinit().
BugLink: https://github.com/alsa-project/alsa-lib/issues/142
Fixes: eefc2c6
("alsactl: use card iterator functions for all card loops")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
ef62ab34fc
commit
78212445de
1 changed files with 2 additions and 0 deletions
|
@ -247,6 +247,8 @@ int snd_card_iterator_sinit(struct snd_card_iterator *iter, const char *cardname
|
|||
int cardno = -1;
|
||||
|
||||
if (cardname) {
|
||||
if (strncmp(cardname, "hw:", 3) == 0)
|
||||
cardname += 3;
|
||||
cardno = snd_card_get_index(cardname);
|
||||
if (cardno < 0) {
|
||||
error("Cannot find soundcard '%s'...", cardname);
|
||||
|
|
Loading…
Reference in a new issue