]> git.alsa-project.org Git - alsa-lib.git/commitdiff
pcm: rate - fix the remaining size calculation in snd_pcm_rate_drain()
authorJaroslav Kysela <perex@perex.cz>
Thu, 23 Apr 2020 11:43:32 +0000 (13:43 +0200)
committerJaroslav Kysela <perex@perex.cz>
Thu, 23 Apr 2020 11:43:32 +0000 (13:43 +0200)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/pcm/pcm_rate.c

index fdcaa8de738240b5ac9d00a2240b4c5bc5700473..21611f62c370918dbed0bb5a7e3ea2aac8fe1c30 100644 (file)
@@ -1060,6 +1060,8 @@ static int snd_pcm_rate_drain(snd_pcm_t *pcm)
                snd_pcm_sw_params(rate->gen.slave, &sw_params);
 
                size = rate->appl_ptr - rate->last_commit_ptr;
+               if (size > pcm->boundary)
+                       size -= pcm->boundary;
                ofs = rate->last_commit_ptr % pcm->buffer_size;
                while (size > 0) {
                        snd_pcm_uframes_t psize, spsize;