1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-23 23:03:55 +02:00

More uses of limitSampleBufferSize

This commit is contained in:
Paul Licameli
2016-08-26 22:02:58 -04:00
parent 156e77fcc7
commit 3b04bb1726
4 changed files with 8 additions and 20 deletions

View File

@@ -502,11 +502,10 @@ bool EffectChangeSpeed::ProcessOne(WaveTrack * track,
auto samplePos = start;
while (samplePos < end) {
//Get a blockSize of samples (smaller than the size of the buffer)
auto blockSize = track->GetBestBlockSize(samplePos);
//Adjust the block size if it is the final block in the track
if (samplePos + blockSize > end)
blockSize = end - samplePos;
auto blockSize = limitSampleBufferSize(
track->GetBestBlockSize(samplePos),
end - samplePos
);
//Get the samples from the track and put them in the buffer
track->Get((samplePtr) inBuffer, floatSample, samplePos, blockSize);