From: Holger Schemel Date: Tue, 26 Apr 2016 19:25:59 +0000 (+0200) Subject: changed playing music to prevent 'plop' sound for certain music files X-Git-Tag: 4.0.0.0-rc2~3 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=f3f6052659f82f865215a70ce3c3e9e207bf0ea0;p=rocksndiamonds.git changed playing music to prevent 'plop' sound for certain music files --- 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); } }