Skip to content

Commit

Permalink
This fix really is specific to native MIDI on Mac OS X
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jan 1, 2012
1 parent bb2e611 commit a495d50
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions music.c 100644 → 100755
Expand Up @@ -739,17 +739,16 @@ static int music_internal_play(Mix_Music *music, double position)
{
int retval = 0;

/* Try to seek instead of do a full halt and restart.
This fixes a bug with native MIDI on Mac OS X, where you
can't really stop and restart from the audio callback.
#ifdef __MACOSX__
/* This fixes a bug with native MIDI on Mac OS X, where you
can't really stop and restart MIDI from the audio callback.
*/
if ( music == music_playing
/* MUS_MOD position isn't time, it's pattern order number (??) */
&& music->type != MUS_MOD ) {
if ( music_internal_position(position) == 0 ) {
return 0;
}
if ( music == music_playing && music->type == MUS_MID && native_midi_ok ) {
/* Just a seek suffices to restart playing */
music_internal_position(position);
return 0;
}
#endif

/* Note the music we're playing */
if ( music_playing ) {
Expand Down

0 comments on commit a495d50

Please sign in to comment.