mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-31 22:25:35 -04:00
Accept string type card
Accept string type card entry to be compatible with others.
This commit is contained in:
parent
5741aec950
commit
145f85fff8
1 changed files with 13 additions and 4 deletions
|
|
@ -686,11 +686,20 @@ static int parse_control_id(snd_config_t *conf, snd_ctl_elem_id_t *ctl_id, int *
|
|||
if (strcmp(id, "comment") == 0)
|
||||
continue;
|
||||
if (strcmp(id, "card") == 0) {
|
||||
const char *str;
|
||||
long v;
|
||||
if ((err = snd_config_get_integer(n, &v)) < 0) {
|
||||
SNDERR("field %s is not an integer", id);
|
||||
if ((err = snd_config_get_string(n, &str)) < 0) {
|
||||
SNDERR("Invalid field %s", id);
|
||||
goto _err;
|
||||
}
|
||||
*cardp = snd_card_get_index(str);
|
||||
if (*cardp < 0) {
|
||||
SNDERR("Cannot get index for %s", str);
|
||||
err = *cardp;
|
||||
goto _err;
|
||||
}
|
||||
} else
|
||||
*cardp = v;
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue