Fixed bug #413
authorSam Lantinga <slouken@libsdl.org>
Sun, 15 Jul 2007 04:41:22 +0000
changeset 356dae4b083e3ef
parent 355 f11a51438868
child 357 d6d0cfdbea65
Fixed bug #413

Fixed a bug with the final loop of samples the length of the audio buffer.
CHANGES
mixer.c
     1.1 --- a/CHANGES	Sun Jul 15 04:36:14 2007 +0000
     1.2 +++ b/CHANGES	Sun Jul 15 04:41:22 2007 +0000
     1.3 @@ -1,4 +1,6 @@
     1.4  1.2.8:
     1.5 +Sam Lantinga - Sat Jul 14 21:39:30 PDT 2007
     1.6 + * Fixed the final loop of audio samples of a certain size
     1.7  Sam Lantinga - Sat Jul 14 21:05:09 PDT 2007
     1.8   * Fixed opening Ogg Vorbis files using different C runtimes on Windows
     1.9  Philippe Simons - Sat Jul 14 20:33:17 PDT 2007
     2.1 --- a/mixer.c	Sun Jul 15 04:36:14 2007 +0000
     2.2 +++ b/mixer.c	Sun Jul 15 04:41:22 2007 +0000
     2.3 @@ -226,9 +226,9 @@
     2.4  				while ( mix_channel[i].looping && index < len ) {
     2.5  					int alen = mix_channel[i].chunk->alen;
     2.6  					remaining = len - index;
     2.7 -				    	if (remaining > alen) {
     2.8 +					if (remaining > alen) {
     2.9  						remaining = alen;
    2.10 -				    	}
    2.11 +					}
    2.12  
    2.13  					mix_input = Mix_DoEffects(i, mix_channel[i].chunk->abuf, remaining);
    2.14  					SDL_MixAudio(stream+index, mix_input, remaining, volume);
    2.15 @@ -241,12 +241,10 @@
    2.16  					index += remaining;
    2.17  				}
    2.18  				if ( ! mix_channel[i].playing && mix_channel[i].looping ) {
    2.19 -					if ( --mix_channel[i].looping ) {
    2.20 -						mix_channel[i].samples = mix_channel[i].chunk->abuf;
    2.21 -						mix_channel[i].playing = mix_channel[i].chunk->alen;
    2.22 -					}
    2.23 +					--mix_channel[i].looping;
    2.24 +					mix_channel[i].samples = mix_channel[i].chunk->abuf;
    2.25 +					mix_channel[i].playing = mix_channel[i].chunk->alen;
    2.26  				}
    2.27 -
    2.28  			}
    2.29  		}
    2.30  	}