music.c
changeset 527 1eddea51f162
parent 521 565549e046b0
child 528 bc0dfe8ae026
     1.1 --- a/music.c	Sat Dec 31 21:26:46 2011 -0500
     1.2 +++ b/music.c	Sat Dec 31 23:00:03 2011 -0500
     1.3 @@ -196,7 +196,6 @@
     1.4  static int music_halt_or_loop (void)
     1.5  {
     1.6  	/* Restart music if it has to loop */
     1.7 -	
     1.8  	if (!music_internal_playing()) 
     1.9  	{
    1.10  		/* Restart music if it has to loop at a high level */
    1.11 @@ -252,10 +251,6 @@
    1.12  			}
    1.13  		}
    1.14  		
    1.15 -		music_halt_or_loop();
    1.16 -		if (!music_internal_playing())
    1.17 -			return;
    1.18 -
    1.19  		switch (music_playing->type) {
    1.20  #ifdef CMD_MUSIC
    1.21  			case MUS_CMD:
    1.22 @@ -282,14 +277,14 @@
    1.23  #ifdef USE_FLUIDSYNTH_MIDI
    1.24  				if ( fluidsynth_ok ) {
    1.25  					fluidsynth_playsome(music_playing->data.fluidsynthmidi, stream, len);
    1.26 -					goto skip;
    1.27 +					break;
    1.28  				}
    1.29  #endif
    1.30  #ifdef USE_TIMIDITY_MIDI
    1.31  				if ( timidity_ok ) {
    1.32  					int samples = len / samplesize;
    1.33    					Timidity_PlaySome(stream, samples);
    1.34 -					goto skip;
    1.35 +					break;
    1.36  				}
    1.37  #endif
    1.38  				break;
    1.39 @@ -319,14 +314,12 @@
    1.40  				/* Unknown music type?? */
    1.41  				break;
    1.42  		}
    1.43 -	}
    1.44  
    1.45 -skip:
    1.46 -	/* Handle seamless music looping */
    1.47 -	if (left > 0 && left < len) {
    1.48 +		/* Handle seamless music looping */
    1.49  		music_halt_or_loop();
    1.50 -		if (music_internal_playing())
    1.51 +		if (left > 0 && left < len && music_internal_playing()) {
    1.52  			music_mixer(udata, stream+(len-left), left);
    1.53 +		}
    1.54  	}
    1.55  }
    1.56