This change (hopefully) fixes a problem that may sporadically occur
when playing MP3 files on Windows, in which case audio output is
either completely silent or music is stuttering instead of playing
normally.
The problem seems to be fixed by stopping the music channel before
playing the next track.
static void FreeSound(void *);
static void FreeMusic(void *);
static void FreeAllMusic_NoConf(void);
static void FreeSound(void *);
static void FreeMusic(void *);
static void FreeAllMusic_NoConf(void);
+static void Mixer_StopMusicChannel(void);
static SoundInfo *getSoundInfoEntryFromSoundID(int);
static MusicInfo *getMusicInfoEntryFromMusicID(int);
static SoundInfo *getSoundInfoEntryFromSoundID(int);
static MusicInfo *getMusicInfoEntryFromMusicID(int);
{
int loops = (IS_LOOP(mixer[audio.music_channel]) ? -1 : 1);
{
int loops = (IS_LOOP(mixer[audio.music_channel]) ? -1 : 1);
+ // stopping music channel before playing next track seems to be needed to
+ // prevent audio problems that may occur when playing MP3 files on Windows
+ Mixer_StopMusicChannel();
+
// use short fade-in to prevent "plop" sound for certain music files
// (this may happen when switching on music while playing the game)
Mix_VolumeMusic(mixer[audio.music_channel].volume);
// use short fade-in to prevent "plop" sound for certain music files
// (this may happen when switching on music while playing the game)
Mix_VolumeMusic(mixer[audio.music_channel].volume);