summaryrefslogtreecommitdiff
path: root/src/midifile.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/midifile.c')
-rw-r--r--src/midifile.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/midifile.c b/src/midifile.c
index 94ec4441..92ffd803 100644
--- a/src/midifile.c
+++ b/src/midifile.c
@@ -699,14 +699,14 @@ int MIDI_GetNextEvent(midi_track_iter_t *iter, midi_event_t **event)
unsigned int MIDI_GetFileTimeDivision(midi_file_t *file)
{
- short result = SHORT(file->header.time_division);
+ short result = SDL_SwapBE16(file->header.time_division);
// Negative time division indicates SMPTE time and must be handled
// differently.
if (result < 0)
{
- // TODO: Figure this out.
- return 96;
+ return (signed int)(-(result/256))
+ * (signed int)(result & 0xFF);
}
else
{