Added name support

This commit is contained in:
Abramo Bagnara 2000-10-10 09:11:07 +00:00
parent 5b3e5e6c74
commit 66df4a7e65
13 changed files with 77 additions and 47 deletions

View file

@ -552,7 +552,7 @@ struct snd_pcm_ops snd_pcm_adpcm_ops = {
munmap_data: snd_pcm_plugin_munmap_data,
};
int snd_pcm_adpcm_open(snd_pcm_t **handlep, int sformat, snd_pcm_t *slave, int close_slave)
int snd_pcm_adpcm_open(snd_pcm_t **handlep, char *name, int sformat, snd_pcm_t *slave, int close_slave)
{
snd_pcm_t *handle;
snd_pcm_adpcm_t *adpcm;
@ -577,6 +577,8 @@ int snd_pcm_adpcm_open(snd_pcm_t **handlep, int sformat, snd_pcm_t *slave, int c
free(adpcm);
return -ENOMEM;
}
if (name)
handle->name = strdup(name);
handle->type = SND_PCM_TYPE_ADPCM;
handle->stream = slave->stream;
handle->ops = &snd_pcm_adpcm_ops;
@ -643,7 +645,7 @@ int _snd_pcm_adpcm_open(snd_pcm_t **pcmp, char *name,
free(sname);
if (err < 0)
return err;
err = snd_pcm_adpcm_open(pcmp, sformat, spcm, 1);
err = snd_pcm_adpcm_open(pcmp, name, sformat, spcm, 1);
if (err < 0)
snd_pcm_close(spcm);
return err;