From 1d1062d92057486f58da92c8df2a8c9387573a30 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 24 Feb 2021 21:03:29 +0100 Subject: [PATCH] pcm: fix snd_pcm_plugin_status() 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 --- src/pcm/pcm_plugin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pcm/pcm_plugin.c b/src/pcm/pcm_plugin.c index ff254eba..24c9941d 100644 --- a/src/pcm/pcm_plugin.c +++ b/src/pcm/pcm_plugin.c @@ -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 { -- 2.11.0