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 - macosx nativemidi special case in music_internal_play()
Summary: macosx nativemidi special case in music_internal_play()
Status: NEW
Alias: None
Product: SDL_mixer
Classification: Unclassified
Component: misc (show other bugs)
Version: unspecified
Hardware: All Mac OS X (All)
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-02 08:25 UTC by Ozkan Sezer
Modified: 2018-08-07 07:32 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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?