Added embedded/anonymous slave PCM definition

This commit is contained in:
Abramo Bagnara 2001-05-14 15:44:37 +00:00
parent 00c749f080
commit 6cb24e0186
15 changed files with 197 additions and 204 deletions

View file

@ -716,10 +716,9 @@ int _snd_pcm_meter_open(snd_pcm_t **pcmp, const char *name,
snd_pcm_stream_t stream, int mode)
{
snd_config_iterator_t i, next;
const char *sname = NULL;
int err;
snd_pcm_t *spcm;
snd_config_t *slave = NULL;
snd_config_t *slave = NULL, *sconf;
long frequency = -1;
snd_config_t *scopes = NULL;
snd_config_for_each(i, next, conf) {
@ -756,15 +755,10 @@ int _snd_pcm_meter_open(snd_pcm_t **pcmp, const char *name,
SNDERR("slave is not defined");
return -EINVAL;
}
err = snd_pcm_slave_conf(slave, &sname, 0);
err = snd_pcm_slave_conf(slave, &sconf, 0);
if (err < 0)
return err;
/* This is needed cause snd_config_update may destroy config */
sname = strdup(sname);
if (!sname)
return -ENOMEM;
err = snd_pcm_open(&spcm, sname, stream, mode);
free((void *) sname);
err = snd_pcm_open_slave(&spcm, sconf, stream, mode);
if (err < 0)
return err;
err = snd_pcm_meter_open(pcmp, name, frequency > 0 ? (unsigned int) frequency : FREQUENCY, spcm, 1);