We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 934

Summary: Native MIDI on OS X does not loop
Product: SDL_mixer Reporter: Simon Howard <fraggle+libsdl>
Component: miscAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P1 CC: renesd
Version: 1.2.11   
Hardware: Other   
OS: Mac OS X (All)   

Description Simon Howard 2010-01-17 10:22:23 UTC
On Mac OS X, when playing a MIDI file with SDL_mixer with the "loops" parameter to Mix_PlayMusic set to 0 (loop forever), the music does not restart again once it has finished playing.
Comment 1 Rene Dudfield 2011-09-06 09:56:42 UTC
I can confirm this bug.

We are tracking this in the pygame bug tracker too at:
    https://bitbucket.org/pygame/pygame/issue/44/pygamemixermusicplay-only-plays-once
Comment 2 Sam Lantinga 2011-12-31 10:46:02 UTC
*** Bug 955 has been marked as a duplicate of this bug. ***
Comment 3 Ryan C. Gordon 2011-12-31 11:39:17 UTC
Bumping priority on a few SDL_mixer bugs. This is just so we know to look at them for an upcoming release, but once we look at them more closely, we may decide to flag them as WONTFIX or push them back to a later release, so don't take this change in priority as any promise of anything, yet.  :)

--ryan.
Comment 4 Sam Lantinga 2011-12-31 15:48:55 UTC
I'll take a look at this bug, I was just poking at the native midi code.
Comment 5 Sam Lantinga 2011-12-31 19:41:00 UTC
Just as a note, loops 0 means don't loop:
   If 'loops' is greater than zero, loop the sound that many times.
   If 'loops' is -1, loop inifinitely (~65000 times).
Comment 6 Sam Lantinga 2011-12-31 21:49:48 UTC
This is fixed, thanks!
http://hg.libsdl.org/SDL_mixer/rev/9ca74f21d466
Comment 7 Sam Lantinga 2012-01-01 13:48:28 UTC
Here is a better fix:
http://hg.libsdl.org/SDL_mixer/rev/f19368c22ebd
Comment 8 Simon Howard 2012-01-01 15:49:40 UTC
Great news, thanks!
Comment 9 Sam Lantinga 2012-01-01 17:27:14 UTC
You're welcome! :)