mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-04 13:30:08 -05:00
rate plugin: optimize calculation of the continuous buffer part
When calculating the continuous part till the end of the buffer, we can use the slave_frames value that has already been calculated by snd_pcm_mmap_begin().
This commit is contained in:
parent
46c67fe070
commit
931e840a9f
1 changed files with 2 additions and 2 deletions
|
|
@ -1032,7 +1032,7 @@ static int snd_pcm_rate_commit_area(snd_pcm_t *pcm, snd_pcm_rate_t *rate,
|
||||||
return result;
|
return result;
|
||||||
__partial:
|
__partial:
|
||||||
xfer = 0;
|
xfer = 0;
|
||||||
cont = rate->gen.slave->buffer_size - slave_offset;
|
cont = slave_frames;
|
||||||
if (cont > slave_size)
|
if (cont > slave_size)
|
||||||
cont = slave_size;
|
cont = slave_size;
|
||||||
snd_pcm_areas_copy(slave_areas, slave_offset,
|
snd_pcm_areas_copy(slave_areas, slave_offset,
|
||||||
|
|
@ -1123,7 +1123,7 @@ static int snd_pcm_rate_grab_next_period(snd_pcm_t *pcm, snd_pcm_uframes_t hw_of
|
||||||
return result;
|
return result;
|
||||||
__partial:
|
__partial:
|
||||||
xfer = 0;
|
xfer = 0;
|
||||||
cont = rate->gen.slave->buffer_size - slave_offset;
|
cont = slave_frames;
|
||||||
if (cont > rate->gen.slave->period_size)
|
if (cont > rate->gen.slave->period_size)
|
||||||
cont = rate->gen.slave->period_size;
|
cont = rate->gen.slave->period_size;
|
||||||
snd_pcm_areas_copy(rate->sareas, 0,
|
snd_pcm_areas_copy(rate->sareas, 0,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue