mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Fixed missing position update in MemoryAudioSource
This commit is contained in:
parent
1d4555fd58
commit
b632360518
1 changed files with 4 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue