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

Rewrite Resample::Process to take and return size_t values

This commit is contained in:
Paul Licameli
2016-09-05 13:44:23 -04:00
parent b093a8e406
commit c8e7372886
11 changed files with 31 additions and 45 deletions

View File

@@ -510,25 +510,20 @@ bool EffectChangeSpeed::ProcessOne(WaveTrack * track,
//Get the samples from the track and put them in the buffer
track->Get((samplePtr) inBuffer, floatSample, samplePos, blockSize);
int inUsed;
int outgen = resample.Process(mFactor,
const auto results = resample.Process(mFactor,
inBuffer,
blockSize,
((samplePos + blockSize) >= end),
&inUsed,
outBuffer,
outBufferSize);
if (outgen < 0) {
bResult = false;
break;
}
const auto outgen = results.second;
if (outgen > 0)
outputTrack->Append((samplePtr)outBuffer, floatSample,
outgen);
// Increment samplePos
samplePos += inUsed;
samplePos += results.first;
// Update the Progress meter
if (TrackProgress(mCurTrackNum, (samplePos - start) / len)) {