From aaaf84387162390a7e8a8b1aca3f2408f9392bd0 Mon Sep 17 00:00:00 2001 From: Clemens Ladisch Date: Mon, 13 Mar 2006 10:40:21 +0000 Subject: [PATCH] rate plugin: fix fragment size calculation When calculating the size of the second fragment, do not assume that the entire size is one period size (which is not true in the draining state) but use the actual size passed by the caller. --- src/pcm/pcm_rate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c index 7f42fa30..414edab6 100644 --- a/src/pcm/pcm_rate.c +++ b/src/pcm/pcm_rate.c @@ -1054,7 +1054,7 @@ static int snd_pcm_rate_commit_area(snd_pcm_t *pcm, snd_pcm_rate_t *rate, return 1; /* commit second fragment */ - cont = rate->gen.slave->period_size - cont; + cont = slave_size - cont; slave_frames = cont; result = snd_pcm_mmap_begin(rate->gen.slave, &slave_areas, &slave_offset, &slave_frames); if (result < 0) -- 2.47.1