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.
This commit is contained in:
Clemens Ladisch 2006-03-13 10:40:21 +00:00
parent 931e840a9f
commit aaaf843871

View 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)