Added support for direct alias

This commit is contained in:
Jaroslav Kysela 2001-06-13 12:55:00 +00:00
parent 396f8a12a2
commit 45cfa1405f

View file

@ -1035,6 +1035,23 @@ static int snd_pcm_open_noupdate(snd_pcm_t **pcmp, snd_config_t *root,
return err;
}
}
if (snd_config_get_type(pcm_conf) == SND_CONFIG_TYPE_STRING) {
snd_config_get_string(pcm_conf, (const char **)&key);
if (args == NULL)
return snd_pcm_open_noupdate(pcmp, root, key, stream, mode);
else {
char *nname;
nname = malloc(strlen(key) + 1 + strlen(args) + 1);
if (nname == NULL)
return -ENOMEM;
strcpy(nname, key);
strcat(nname, ":");
strcat(nname, args);
err = snd_pcm_open_noupdate(pcmp, root, nname, stream, mode);
free(nname);
return err;
}
}
err = snd_config_expand(pcm_conf, args, NULL, &pcm_conf);
if (err < 0) {
SNDERR("Could not expand configuration: %s", snd_strerror(err));