mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 20:41:46 +00:00
SDL mixer: Fix no looping bug when changing song position
# Conflicts: # src/sdl12/mixer_sound.c
This commit is contained in:
parent
ca3ceb30b9
commit
58727a3bba
1 changed files with 9 additions and 3 deletions
|
|
@ -793,9 +793,15 @@ boolean I_SetSongPosition(UINT32 position)
|
||||||
{
|
{
|
||||||
if(midimode || !music)
|
if(midimode || !music)
|
||||||
return false;
|
return false;
|
||||||
Mix_PlayMusic(music, 0);
|
Mix_RewindMusic(); // needed for mp3
|
||||||
Mix_SetMusicPosition((float)(position/1000.0L));
|
if(Mix_SetMusicPosition((float)(position/1000.0L)) == 0)
|
||||||
music_bytes = position/1000.0L*44100.0L*4; //assume 44.1khz, 4-byte length (see I_GetSongPositon)
|
music_bytes = position/1000.0L*44100.0L*4; //assume 44.1khz, 4-byte length (see I_GetSongPositon)
|
||||||
|
else
|
||||||
|
// NOTE: This block fires on incorrect song format,
|
||||||
|
// NOT if position input is greater than song length.
|
||||||
|
// This means music_bytes will be inaccurate because we can't compare to
|
||||||
|
// max song length. So, don't write your scripts to seek beyond the song.
|
||||||
|
music_bytes = 0;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue