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,12 +686,21 @@ static int parse_control_id(snd_config_t *conf, snd_ctl_elem_id_t *ctl_id, int *
|
||||||
if (strcmp(id, "comment") == 0)
|
if (strcmp(id, "comment") == 0)
|
||||||
continue;
|
continue;
|
||||||
if (strcmp(id, "card") == 0) {
|
if (strcmp(id, "card") == 0) {
|
||||||
|
const char *str;
|
||||||
long v;
|
long v;
|
||||||
if ((err = snd_config_get_integer(n, &v)) < 0) {
|
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) {
|
||||||
goto _err;
|
SNDERR("Invalid field %s", id);
|
||||||
}
|
goto _err;
|
||||||
*cardp = v;
|
}
|
||||||
|
*cardp = snd_card_get_index(str);
|
||||||
|
if (*cardp < 0) {
|
||||||
|
SNDERR("Cannot get index for %s", str);
|
||||||
|
err = *cardp;
|
||||||
|
goto _err;
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
*cardp = v;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (strcmp(id, "iface") == 0 || strcmp(id, "interface") == 0) {
|
if (strcmp(id, "iface") == 0 || strcmp(id, "interface") == 0) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue