mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Fix modplug-decoded streaming Sources when looping repeatedly, and when stop() is called on them. Resolves issue #1493.
This commit is contained in:
@@ -425,6 +425,18 @@ bool Source::update()
|
||||
unusedBuffers.push(buffer);
|
||||
}
|
||||
|
||||
while (!unusedBuffers.empty())
|
||||
{
|
||||
ALuint b = unusedBuffers.top();
|
||||
if (streamAtomic(b, decoder.get()) > 0)
|
||||
{
|
||||
alSourceQueueBuffers(source, 1, &b);
|
||||
unusedBuffers.pop();
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -869,7 +881,8 @@ void Source::teardownAtomic()
|
||||
ALint queued = 0;
|
||||
ALuint buffers[MAX_BUFFERS];
|
||||
|
||||
decoder->seek(0);
|
||||
// Some decoders (e.g. ModPlug) can rewind() more reliably than seek(0).
|
||||
decoder->rewind();
|
||||
|
||||
// Drain buffers.
|
||||
// NOTE: The Apple implementation of OpenAL on iOS doesn't return
|
||||
|
||||
Reference in New Issue
Block a user