mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
Added name support
This commit is contained in:
parent
5b3e5e6c74
commit
66df4a7e65
13 changed files with 77 additions and 47 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue