OSDN Git Service

pcm: fix snd_pcm_plugin_status()
authorJaroslav Kysela <perex@perex.cz>
Wed, 24 Feb 2021 20:03:29 +0000 (21:03 +0100)
committerJaroslav Kysela <perex@perex.cz>
Fri, 26 Feb 2021 20:08:28 +0000 (21:08 +0100)
The appl_ptr difference must be computed before
the appl_ptr in the status structure is updated.

Fixes: da5b70d3f ("pcm: plugin - fix status code for capture")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/pcm/pcm_plugin.c

index ff254eb..24c9941 100644 (file)
@@ -564,8 +564,8 @@ static int snd_pcm_plugin_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
         *    snd_pcm_status()
         */
        if (pcm->stream == SND_PCM_STREAM_CAPTURE) {
-               status->appl_ptr = *pcm->appl.ptr;
                diff = pcm_frame_diff(status->appl_ptr, *pcm->appl.ptr, pcm->boundary);
+               status->appl_ptr = *pcm->appl.ptr;
                status->avail += diff;
                status->delay += diff;
        } else {