Improved .asoundrc changes

This commit is contained in:
Abramo Bagnara 2001-03-17 16:34:43 +00:00
parent 0300bbbbb3
commit a275d66356
25 changed files with 888 additions and 612 deletions

View file

@ -718,6 +718,7 @@ int _snd_pcm_plug_open(snd_pcm_t **pcmp, const char *name,
const char *sname = NULL;
int err;
snd_pcm_t *spcm;
snd_config_t *slave = NULL;
snd_config_t *tt = NULL;
snd_pcm_route_ttable_entry_t *ttable = NULL;
unsigned int cused, sused;
@ -728,12 +729,8 @@ int _snd_pcm_plug_open(snd_pcm_t **pcmp, const char *name,
continue;
if (strcmp(id, "type") == 0)
continue;
if (strcmp(id, "sname") == 0) {
err = snd_config_get_string(n, &sname);
if (err < 0) {
SNDERR("Invalid type for %s", id);
return -EINVAL;
}
if (strcmp(id, "slave") == 0) {
slave = n;
continue;
}
if (strcmp(id, "ttable") == 0) {
@ -747,10 +744,13 @@ int _snd_pcm_plug_open(snd_pcm_t **pcmp, const char *name,
SNDERR("Unknown field %s", id);
return -EINVAL;
}
if (!sname) {
SNDERR("sname is not defined");
if (!slave) {
SNDERR("slave is not defined");
return -EINVAL;
}
err = snd_pcm_slave_conf(slave, &sname, 0);
if (err < 0)
return err;
if (tt) {
ttable = malloc(MAX_CHANNELS * MAX_CHANNELS * sizeof(*ttable));
err = snd_pcm_route_load_ttable(tt, ttable, MAX_CHANNELS, MAX_CHANNELS,