Don't stop and reset playing audio if we've hit what we think is the end and want to loop,

but it's a tracker format (.mod, .xm), rather than a stream - this fixes the case where
only half the song would play. (Fixes #989)
This commit is contained in:
illegalinstruction 2020-01-15 13:18:35 -08:00
parent 56e7a75a77
commit 546f8a583b

View File

@ -1482,7 +1482,18 @@ void UpdateMusicStream(Music music)
// Reset audio stream for looping // Reset audio stream for looping
if (streamEnding) if (streamEnding)
{ {
StopMusicStream(music); // Stop music (and reset) // is this a tracker format or a streamed one (ogg, wav, etc.)
if (!((music.ctxType == MUSIC_MODULE_XM) || (music.ctxType == MUSIC_MODULE_MOD)))
{
// streamed - stop the music and reset it.
StopMusicStream(music);
}
else
{
// tracker - don't reset it, but remember that we have hit
// the loop point and are playing normally again.
streamEnding = false;
}
// Decrease loopCount to stop when required // Decrease loopCount to stop when required
if (music.loopCount > 1) if (music.loopCount > 1)