diff --git a/README.html b/README.html index c5e4486..f37841e 100644 --- a/README.html +++ b/README.html @@ -18,7 +18,7 @@
SoundTouch library Copyright (c) Olli Parviainen 2002-2009
@@ -695,9 +695,12 @@ SoundTouch v1.3.1: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...