]> git.alsa-project.org Git - alsa-lib.git/commitdiff
pcm: ioplug: Pass appl_ptr and hw_ptr in snd_pcm_status()
authorTakashi Iwai <tiwai@suse.de>
Fri, 22 Jan 2021 14:48:40 +0000 (15:48 +0100)
committerJaroslav Kysela <perex@perex.cz>
Fri, 22 Jan 2021 16:58:07 +0000 (17:58 +0100)
The snd_pcm_status() of the ioplug doesn't return the current
positions of hw_ptr and appl_ptr as advertised.  Fix it by copying the
current values stored in the plugin data.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/pcm/pcm_ioplug.c

index e141b1f98da71adf5d49e2f4c54e5130c2c9f615..a1463bf6b50abe964f29f74c5ac5b9dffacaf295 100644 (file)
@@ -133,6 +133,8 @@ static int snd_pcm_ioplug_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
        gettimestamp(&status->tstamp, pcm->tstamp_type);
        status->avail = snd_pcm_mmap_avail(pcm);
        status->avail_max = io->avail_max;
+       status->appl_ptr = *pcm->appl.ptr;
+       status->hw_ptr = *pcm->hw.ptr;
        if (snd_pcm_ioplug_delay(pcm, &sd) < 0)
                sd = snd_pcm_mmap_delay(pcm);
        status->delay = sd;