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 4221

Summary: macosx nativemidi special case in music_internal_play()
Product: SDL_mixer Reporter: Ozkan Sezer <sezeroz>
Component: miscAssignee: Ryan C. Gordon <icculus>
Status: NEW --- QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: unspecified   
Hardware: All   
OS: Mac OS X (All)   

Description Ozkan Sezer 2018-08-02 08:25:57 UTC
In music.c:music_internal_play() 
http://hg.libsdl.org/SDL_mixer/file/0eda5db47348/music.c#l681

static int music_internal_play(Mix_Music *music, int play_count, double position)
{
    int retval = 0;

#if defined(__MACOSX__) && defined(MID_MUSIC_NATIVE)
    /* 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 && music->api == MIX_MUSIC_NATIVEMIDI) {
        /* Just a seek suffices to restart playing */
        music_internal_position(position);
        return 0;
    }
#endif

As far as I can see, Mix_MusicInterface_NATIVEMIDI has a NULL
Seek function (see in music_nativemidi.c#l97) and as a result,
music_internal_position() will do nothing returning (-1), and
nothing will happen.

Is this really intended?  Am I missing something?
Comment 1 Ozkan Sezer 2018-08-07 07:32:56 UTC
Any ideas about this?