mirror of
https://github.com/openharmony/third_party_alsa-utils.git
synced 2026-07-19 12:42:03 -04: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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user