[PATCH] SDL_mixer doesn't call _Mix_channel_done_playing when fading out/expiring

Hi!

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.

So long
Thomas–
___ Obviously we do not want to leave zombies around.
/\ - W. Richard Stevens
( ^ > Thomas Krennwallner
/ \ 1024D/67A1DA7B 9484 D99D 2E1E 4E02 5446 DAD9 FF58 4E59 67A1 DA7B
(
/) http://bigfish.ull.at/~djmaecki/
-------------- next part --------------
Index: mixer.c

RCS file: /home/sdlweb/libsdl.org/cvs/SDL_mixer/mixer.c,v
retrieving revision 1.46
diff -u -r1.46 mixer.c
— mixer.c 2002/12/02 00:38:07 1.46
+++ mixer.c 2003/02/20 12:30:20
@@ -172,6 +172,7 @@
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 ) {
    

@@ -179,6 +180,7 @@
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 {
    

-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20030220/070c8250/attachment.pgp

Hi!

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.

Thanks, I’ve added your patch to CVS.

See ya!
-Sam Lantinga, Software Engineer, Blizzard Entertainment