From: Clemens Ladisch Date: Mon, 13 Mar 2006 10:40:21 +0000 (+0000) Subject: rate plugin: fix fragment size calculation X-Git-Tag: v1.0.11rc4~17 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=aaaf84387162390a7e8a8b1aca3f2408f9392bd0;p=alsa-lib.git 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. --- 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)