X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Flibgame%2Fsound.c;h=e860ba5ad443acd63e2669618d3f7c5e04c0872d;hp=4831248c86d2b9abc1ef56cf9ad0cd885ebc06c3;hb=00383dd409fde133c6738231abfcee662c03087c;hpb=4239ba2adc93afb81230b1a4ea42e7eaf68452c6 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); } }