From f3f6052659f82f865215a70ce3c3e9e207bf0ea0 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Tue, 26 Apr 2016 21:25:59 +0200 Subject: [PATCH] changed playing music to prevent 'plop' sound for certain music files --- src/libgame/sound.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libgame/sound.c b/src/libgame/sound.c index 4831248c..e860ba5a 100644 --- a/src/libgame/sound.c +++ b/src/libgame/sound.c @@ -219,10 +219,10 @@ static void Mixer_PlayMusicChannel() if (mixer[audio.music_channel].type != MUS_TYPE_WAV) { - /* Mix_VolumeMusic() must be called _after_ Mix_PlayMusic() -- - this looks like a bug in the SDL_mixer library */ - Mix_PlayMusic(mixer[audio.music_channel].data_ptr, -1); + // 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); + Mix_FadeInMusic(mixer[audio.music_channel].data_ptr, -1, 100); } } -- 2.34.1