This fix really is specific to native MIDI on Mac OS X
authorSam Lantinga <slouken@libsdl.org>
Sun, 01 Jan 2012 14:23:22 -0500
changeset 531f9c790738ec3
parent 530 a74d68325094
child 532 b8e8ae4852b2
This fix really is specific to native MIDI on Mac OS X
music.c
     1.1 --- a/music.c	Sun Jan 01 01:00:51 2012 -0500
     1.2 +++ b/music.c	Sun Jan 01 14:23:22 2012 -0500
     1.3 @@ -739,17 +739,16 @@
     1.4  {
     1.5  	int retval = 0;
     1.6  
     1.7 -	/* Try to seek instead of do a full halt and restart.
     1.8 -	   This fixes a bug with native MIDI on Mac OS X, where you
     1.9 -	   can't really stop and restart from the audio callback.
    1.10 +#ifdef __MACOSX__
    1.11 +	/* This fixes a bug with native MIDI on Mac OS X, where you
    1.12 +	   can't really stop and restart MIDI from the audio callback.
    1.13  	*/
    1.14 -	if ( music == music_playing
    1.15 -	  /* MUS_MOD position isn't time, it's pattern order number (??) */
    1.16 -	     && music->type != MUS_MOD ) {
    1.17 -		if ( music_internal_position(position) == 0 ) {
    1.18 -			return 0;
    1.19 -		}
    1.20 +	if ( music == music_playing && music->type == MUS_MID && native_midi_ok ) {
    1.21 +		/* Just a seek suffices to restart playing */
    1.22 +		music_internal_position(position);
    1.23 +		return 0;
    1.24  	}
    1.25 +#endif
    1.26  
    1.27  	/* Note the music we're playing */
    1.28  	if ( music_playing ) {