OSDN Git Service

Added name support
[android-x86/external-alsa-lib.git] / src / pcm / pcm_adpcm.c
index ee6580c..4c916ab 100644 (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;