Fix #6 #7 SDL looping and counter bugs when looping=false

# Conflicts:
#	src/sdl12/mixer_sound.c
This commit is contained in:
mazmazz 2018-08-15 02:15:05 -04:00
parent 11c6148d4b
commit e0ab8c1ed0

View file

@ -438,6 +438,13 @@ void I_SetSfxVolume(UINT8 volume)
// Music
//
static void count_music_bytes(int chan, void *stream, int len, void *udata)
{
if(midimode || !music)
return;
music_bytes += len;
}
// Music hooks
static void music_loop(void)
{
@ -448,14 +455,12 @@ static void music_loop(void)
music_bytes = loop_point/1000.0L*44100.0L*4; //assume 44.1khz, 4-byte length (see I_GetMusicPosition)
}
else
music_bytes = 0;
}
static void count_music_bytes(int chan, void *stream, int len, void *udata)
{
if(midimode || !music)
return;
music_bytes += len;
{
Mix_UnregisterEffect(MIX_CHANNEL_POST, count_music_bytes);
music_bytes = 0;
// be consistent with FMOD, otherwise I'd prefer to freeze music_bytes
// since the other flags indicate music is still playing.
}
}
#ifdef HAVE_LIBGME