mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Avoided an edge-case in the ResamplingAudioSource
This commit is contained in:
parent
50a55b2e9c
commit
8f1dbc254b
1 changed files with 4 additions and 3 deletions
|
|
@ -93,7 +93,7 @@ void ResamplingAudioSource::getNextAudioBlock (const AudioSourceChannelInfo& inf
|
|||
lastRatio = localRatio;
|
||||
}
|
||||
|
||||
const int sampsNeeded = roundToInt (info.numSamples * localRatio) + 2;
|
||||
const int sampsNeeded = roundToInt (info.numSamples * localRatio) + 3;
|
||||
|
||||
int bufferSize = buffer.getNumSamples();
|
||||
|
||||
|
|
@ -138,8 +138,11 @@ void ResamplingAudioSource::getNextAudioBlock (const AudioSourceChannelInfo& inf
|
|||
}
|
||||
|
||||
int nextPos = (bufferPos + 1) % bufferSize;
|
||||
|
||||
for (int m = info.numSamples; --m >= 0;)
|
||||
{
|
||||
jassert (sampsInBuffer > 0 && nextPos != endOfBufferPos);
|
||||
|
||||
const float alpha = (float) subSampleOffset;
|
||||
|
||||
for (int channel = 0; channel < channelsToProcess; ++channel)
|
||||
|
|
@ -148,8 +151,6 @@ void ResamplingAudioSource::getNextAudioBlock (const AudioSourceChannelInfo& inf
|
|||
|
||||
subSampleOffset += localRatio;
|
||||
|
||||
jassert (sampsInBuffer > 0);
|
||||
|
||||
while (subSampleOffset >= 1.0)
|
||||
{
|
||||
if (++bufferPos >= bufferSize)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue