Merge branch 'main' into 12.0-development

This commit is contained in:
Sasha Szpakowski
2022-12-04 19:52:25 -04:00
2 changed files with 184 additions and 8 deletions
+13 -8
View File
@@ -1160,6 +1160,19 @@ int Source::streamAtomic(ALuint buffer, love::sound::Decoder *d)
decoded = 0;
}
// This shouldn't run after toLoop is calculated in this streamAtomic call,
// otherwise it'll decrease too quickly.
// TODO: this code is hard to understand, can it be made more clear?
// It's meant to reset offsetSamples once OpenAL starts processing the first
// queued buffer after a loop.
if (toLoop > 0)
{
if (--toLoop == 0)
{
offsetSamples = 0;
}
}
if (decoder->isFinished() && isLooping())
{
int queued, processed;
@@ -1172,14 +1185,6 @@ int Source::streamAtomic(ALuint buffer, love::sound::Decoder *d)
d->rewind();
}
if (toLoop > 0)
{
if (--toLoop == 0)
{
offsetSamples = 0;
}
}
return decoded;
}