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 357

Summary: Mix_SetMusicCMD and playing forever
Product: SDL_mixer Reporter: Darius Scerbavicius <darius.scerb>
Component: miscAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: unspecified   
Hardware: x86   
OS: Linux   
Attachments: simple test program and a midi file

Description Darius Scerbavicius 2006-11-04 01:28:43 UTC
On Ubuntu Edgy with SDL_mixer 1.2.7 and SDL_mixer 1.2.6, after setting music cmd and trying to play music forever ( Mix_PlayMusic(music, -1); ), after it loops the first time, I cannot quit in the middle. I have to wait for it to finish first. It quits fine before it starts looping.
Is this a bug or am i doing something wrong?
Comment 1 Darius Scerbavicius 2006-11-04 01:31:45 UTC
Created attachment 179 [details]
simple test program and a midi file

Seems to happen with both Mix_SetMusicCMD("timidity"); and Mix_SetMusicCMD("aplaymidi -p 17:0"); but doesn't happen when I don't use Mix_SetMusicCMD.
Comment 2 Sam Lantinga 2009-10-11 01:41:49 UTC
Thanks, this was a sneaky one!
When music loops, the looping music play call is done from the audio thread, and
 SDL threads block signals to avoid signal side effects.  So we just need to unb
lock those signals before executing the new process.

You provided a great test case, thanks!

This is fixed for the next release. :)