[Commits] SDL_mixer: Mix_Playing() should return false on a looping channe...

libsdl.org revision control commits-owner at libsdl.org
Mon Jan 2 18:56:57 PST 2012


details:   http://hg.libsdl.org/SDL_mixer/rev/e7c80564dda5
changeset: 539:e7c80564dda5
user:      Ryan C. Gordon <icculus at icculus.org>
date:      Mon Jan 02 18:51:22 2012 -0800
description:
Mix_Playing() should return false on a looping channel that's been faded out.

Fixes Bugzilla #1180.

Thanks to Aki Koskinen for the patch!

diffstat:

 mixer.c |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (37 lines):

diff -r b5e3fe1b5a09 -r e7c80564dda5 mixer.c
--- a/mixer.c	Mon Jul 18 23:35:08 2011 -0700
+++ b/mixer.c	Mon Jan 02 18:51:22 2012 -0800
@@ -306,6 +306,7 @@
 			if ( mix_channel[i].expire > 0 && mix_channel[i].expire < sdl_ticks ) {
 				/* Expiration delay for that channel is reached */
 				mix_channel[i].playing = 0;
+				mix_channel[i].looping = 0;
 				mix_channel[i].fading = MIX_NO_FADING;
 				mix_channel[i].expire = 0;
 				_Mix_channel_done_playing(i);
@@ -315,6 +316,7 @@
 				    Mix_Volume(i, mix_channel[i].fade_volume_reset); /* Restore the volume */
 					if( mix_channel[i].fading == MIX_FADING_OUT ) {
 						mix_channel[i].playing = 0;
+						mix_channel[i].looping = 0;
 						mix_channel[i].expire = 0;
 						_Mix_channel_done_playing(i);
 					}
@@ -729,6 +731,7 @@
 			for ( i=0; i<num_channels; ++i ) {
 				if ( chunk == mix_channel[i].chunk ) {
 					mix_channel[i].playing = 0;
+					mix_channel[i].looping = 0;
 				}
 			}
 		}
@@ -988,7 +991,8 @@
 		SDL_LockAudio();
 		if (mix_channel[which].playing) {
 			_Mix_channel_done_playing(which);
-		mix_channel[which].playing = 0;
+			mix_channel[which].playing = 0;
+			mix_channel[which].looping = 0;
 		}
 		mix_channel[which].expire = 0;
 		if(mix_channel[which].fading != MIX_NO_FADING) /* Restore volume */


More information about the commits mailing list