Browse Source

Fixed missing position update in MemoryAudioSource

tags/2021-05-28
hogliux 7 years ago
parent
commit
b632360518
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      modules/juce_audio_basics/sources/juce_MemoryAudioSource.cpp

+ 4
- 1
modules/juce_audio_basics/sources/juce_MemoryAudioSource.cpp View File

@@ -49,7 +49,8 @@ void MemoryAudioSource::getNextAudioBlock (const AudioSourceChannelInfo& bufferT
auto max = 0, pos = 0;
auto n = buffer.getNumSamples(), m = bufferToFill.numSamples;
for (auto i = position; (i < n || isLooping) && (pos < m); i += max)
int i;
for (i = position; (i < n || isLooping) && (pos < m); i += max)
{
max = jmin (m - pos, n - (i % n));
@@ -65,6 +66,8 @@ void MemoryAudioSource::getNextAudioBlock (const AudioSourceChannelInfo& bufferT
if (pos < m)
dst.clear (bufferToFill.startSample + pos, m - pos);
position = (i % n);
}
} // namespace juce

Loading…
Cancel
Save