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 812

Summary: Native (QuickTime) based MIDI does not work in 64bit mode
Product: SDL_mixer Reporter: Max Horn <max>
Component: miscAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: unspecified   
Hardware: PowerPC   
OS: Mac OS X (All)   

Description Max Horn 2009-09-27 11:58:18 UTC
I got build failure reports from various people for SDL-mixer on OS X when compiling in 64bit mode, both in 10.5 and 10.6. The reason: Deprecated QuickTime APIs that have been removed for 64bit binaries, see below.

Proposed short-term workaround: Disable or just remove the crappy "native" MIDI code. It's rather bad anyway (I should know, i wrote it ;).

Mid/long-term solution: Write new CoreAudio based code to replace it. That code then would work on all OS X versions (well, at least on 10.4 upwards for sure), be more accurate, sound better and take up less system resources. And be simpler, did I mention that? Generating MIDI output with CoreAudio is pretty easy, we do it in ScummVM, Exult, Pentagram, DOSBox, ... 

Here are the build errors:

gcc -I/sw64/include -D_GNU_SOURCE=1 -I/sw64/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -DCMD_MUSIC -DWAV_MUSIC -DMOD_MUSIC -I./mikmod -DMID_MUSIC -DUSE_TIMIDITY_MIDI -I./timidity -DUSE_NATIVE_MIDI -I./native_midi -DOGG_MUSIC -DMP3_MUSIC -I/sw64/include -I/sw64/include/smpeg -I/sw64/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -c ./native_midi/native_midi_mac.c  -fno-common -DPIC -o build/.libs/native_midi_mac.o
./native_midi/native_midi_mac.c:51: error: 'NoteRequest' undeclared here (not in a function)
./native_midi/native_midi_mac.c:79: error: syntax error before 'gTunePlayer'
./native_midi/native_midi_mac.c:79: warning: initialization makes integer from pointer without a cast
./native_midi/native_midi_mac.c:79: warning: data definition has no type or storage class
./native_midi/native_midi_mac.c: In function 'native_midi_loadsong':
./native_midi/native_midi_mac.c:134: warning: comparison between pointer and integer
./native_midi/native_midi_mac.c:135: error: 'kTunePlayerComponentType' undeclared (first use in this function)
./native_midi/native_midi_mac.c:135: error: (Each undeclared identifier is reported only once
./native_midi/native_midi_mac.c:135: error: for each function it appears in.)
./native_midi/native_midi_mac.c:135: warning: assignment makes integer from pointer without a cast
./native_midi/native_midi_mac.c: In function 'native_midi_loadsong_RW':
./native_midi/native_midi_mac.c:197: warning: comparison between pointer and integer
./native_midi/native_midi_mac.c:198: error: 'kTunePlayerComponentType' undeclared (first use in this function)
./native_midi/native_midi_mac.c:198: warning: assignment makes integer from pointer without a cast
./native_midi/native_midi_mac.c: In function 'native_midi_freesong':
./native_midi/native_midi_mac.c:239: warning: comparison between pointer and integer
./native_midi/native_midi_mac.c:241: warning: passing argument 1 of 'CloseComponent' makes pointer from integer without a cast
./native_midi/native_midi_mac.c:242: warning: assignment makes integer from pointer without a cast
./native_midi/native_midi_mac.c: In function 'native_midi_start':
./native_midi/native_midi_mac.c:251: warning: comparison between pointer and integer
./native_midi/native_midi_mac.c:260: error: 'kTuneStartNow' undeclared (first use in this function)
./native_midi/native_midi_mac.c: In function 'native_midi_stop':
./native_midi/native_midi_mac.c:310: warning: comparison between pointer and integer
./native_midi/native_midi_mac.c: In function 'native_midi_active':
./native_midi/native_midi_mac.c:322: warning: comparison between pointer and integer
./native_midi/native_midi_mac.c:324: error: 'TuneStatus' undeclared (first use in this function)
./native_midi/native_midi_mac.c:324: error: syntax error before 'ts'
./native_midi/native_midi_mac.c:326: error: 'ts' undeclared (first use in this function)
./native_midi/native_midi_mac.c: In function 'native_midi_setvolume':
./native_midi/native_midi_mac.c:335: warning: comparison between pointer and integer
./native_midi/native_midi_mac.c: In function 'BuildTuneSequence':
./native_midi/native_midi_mac.c:432: error: 'kFirstDrumkit' undeclared (first use in this function)
./native_midi/native_midi_mac.c:434: error: 'kFirstGMInstrument' undeclared (first use in this function)
./native_midi/native_midi_mac.c:504: error: 'kControllerVolume' undeclared (first use in this function)
./native_midi/native_midi_mac.c:516: error: 'kControllerPan' undeclared (first use in this function)
./native_midi/native_midi_mac.c:567: error: 'kControllerPitchBend' undeclared (first use in this function)
./native_midi/native_midi_mac.c:618: error: 'kEndMarkerValue' undeclared (first use in this function)
./native_midi/native_midi_mac.c: In function 'BuildTuneHeader':
./native_midi/native_midi_mac.c:627: error: 'myNoteRequest' undeclared (first use in this function)
./native_midi/native_midi_mac.c:628: error: 'NoteAllocator' undeclared (first use in this function)
./native_midi/native_midi_mac.c:628: error: syntax error before 'myNoteAllocator'
./native_midi/native_midi_mac.c:633: error: 'myNoteAllocator' undeclared (first use in this function)
./native_midi/native_midi_mac.c:638: error: 'kNoteAllocatorComponentType' undeclared (first use in this function)
./native_midi/native_midi_mac.c:661: error: 'kGeneralEventNoteRequest' undeclared (first use in this function)
./native_midi/native_midi_mac.c:662: error: syntax error before ')' token
./native_midi/native_midi_mac.c:688: error: 'kEndMarkerValue' undeclared (first use in this function)
make: *** [build/native_midi_mac.lo] Error 1
### execution of make failed, exit code 2
"
Comment 1 Sam Lantinga 2009-09-27 12:34:37 UTC
Okay, it's disabled for now.  I'll take a patch anytime! :)