Accept string type card

Accept string type card entry to be compatible with others.
This commit is contained in:
Takashi Iwai 2005-02-22 20:21:23 +00:00
parent 5741aec950
commit 145f85fff8

View file

@ -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;
}