From: Abramo Bagnara Date: Sat, 14 Oct 2000 10:43:02 +0000 (+0000) Subject: Interpret id as card if a definition is not found X-Git-Tag: v1.0.3~1101 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=8d554635af336c89203676d3ff652ee87a5501a7;p=alsa-lib.git Interpret id as card if a definition is not found --- diff --git a/src/control/control.c b/src/control/control.c index e0b6c058..341af124 100644 --- a/src/control/control.c +++ b/src/control/control.c @@ -163,8 +163,10 @@ int snd_ctl_open(snd_ctl_t **ctlp, char *name) if (err < 0) return err; err = snd_config_searchv(snd_config, &ctl_conf, "ctl", name, 0); - if (err < 0) - return err; + if (err < 0) { + int cardno = snd_card_get_index(name); + return snd_ctl_hw_open(ctlp, name, cardno); + } if (snd_config_type(ctl_conf) != SND_CONFIG_TYPE_COMPOUND) return -EINVAL; err = snd_config_search(ctl_conf, "type", &conf);