Skip to content

Commit

Permalink
Date: Thu, 20 Feb 2003 13:39:49 +0100
Browse files Browse the repository at this point in the history
From: Thomas Krennwallner
Subject: [SDL] [PATCH] SDL_mixer doesn't call _Mix_channel_done_playing when f

Just encountered, that SDL_mixer doesn't call my callback function
registered with Mix_ChannelFinished() when I call Mix_FadeOutChannel()
or Mix_ExpireChannel(). This patch should fix this.
  • Loading branch information
slouken committed Feb 25, 2003
1 parent b61167d commit 6114795
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mixer.c
Expand Up @@ -172,13 +172,15 @@ static void mix_channels(void *udata, Uint8 *stream, int len)
mix_channel[i].playing = 0;
mix_channel[i].fading = MIX_NO_FADING;
mix_channel[i].expire = 0;
_Mix_channel_done_playing(i);
} else if ( mix_channel[i].fading != MIX_NO_FADING ) {
Uint32 ticks = sdl_ticks - mix_channel[i].ticks_fade;
if( ticks > mix_channel[i].fade_length ) {
if( mix_channel[i].fading == MIX_FADING_OUT ) {
mix_channel[i].playing = 0;
mix_channel[i].expire = 0;
Mix_Volume(i, mix_channel[i].fade_volume); /* Restore the volume */
_Mix_channel_done_playing(i);
}
mix_channel[i].fading = MIX_NO_FADING;
} else {
Expand Down

0 comments on commit 6114795

Please sign in to comment.