From df3631599107a6e1ba5221a7919d18b96b309086 Mon Sep 17 00:00:00 2001
From: oparviai SoundTouch library Copyright (c) Olli
Parviainen 2002-2009
-SoundTouch audio processing library v1.4.1
+
SoundTouch audio processing library v1.4.1pre
Moral greetings to all other contributors and users also!
diff --git a/source/SoundTouch/RateTransposer.cpp b/source/SoundTouch/RateTransposer.cpp index 40179f1..bb2b4c7 100644 --- a/source/SoundTouch/RateTransposer.cpp +++ b/source/SoundTouch/RateTransposer.cpp @@ -248,9 +248,9 @@ void RateTransposer::downsample(const SAMPLETYPE *src, uint nSamples) // If the parameter 'uRate' value is larger than 'SCALE', first apply the // anti-alias filter to remove high frequencies (prevent them from folding - // over the lover frequencies), then transpose. */ + // over the lover frequencies), then transpose. - // Add the new samples to the end of the storeBuffer */ + // Add the new samples to the end of the storeBuffer storeBuffer.putSamples(src, nSamples); // Anti-alias filter the samples to prevent folding and output the filtered @@ -262,6 +262,8 @@ void RateTransposer::downsample(const SAMPLETYPE *src, uint nSamples) count = pAAFilter->evaluate(tempBuffer.ptrEnd(sizeTemp), storeBuffer.ptrBegin(), sizeTemp, (uint)numChannels); + if (count == 0) return; + // Remove the filtered samples from 'storeBuffer' storeBuffer.receiveSamples(count); @@ -398,7 +400,9 @@ uint RateTransposerInteger::transposeMono(SAMPLETYPE *dest, const SAMPLETYPE *sr unsigned int i, used; LONG_SAMPLETYPE temp, vol1; - used = 0; + if (nSamples == 0) return 0; // no samples, no work + + used = 0; i = 0; // Process the last sample saved from the previous call first...