changed "http" to "https" in URLs
[rocksndiamonds.git] / src / libgame / sound.c
index ed50734bacf0e1ce5f5ba8b360b6f1f7a82af186..4f5ddd0b2ca46fd741863cf36d9fa3d00b259ade 100644 (file)
@@ -4,7 +4,7 @@
 // (c) 1995-2014 by Artsoft Entertainment
 //                         Holger Schemel
 //                 info@artsoft.org
-//                 http://www.artsoft.org/
+//                 https://www.artsoft.org/
 // ----------------------------------------------------------------------------
 // sound.c
 // ============================================================================
@@ -131,6 +131,7 @@ static void ReloadCustomMusic(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);
@@ -223,6 +224,10 @@ static void Mixer_PlayMusicChannel(void)
   {
     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);