]> git.alsa-project.org Git - alsa-lib.git/commitdiff
rate plugin: fix fragment size calculation
authorClemens Ladisch <clemens@ladisch.de>
Mon, 13 Mar 2006 10:40:21 +0000 (10:40 +0000)
committerClemens Ladisch <clemens@ladisch.de>
Mon, 13 Mar 2006 10:40:21 +0000 (10:40 +0000)
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

index 7f42fa300e6723b8afa0090b598eb080244d0201..414edab64e8d3fd16fe9a678d96d5ca918086448 100644 (file)
@@ -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)