[Scummvm-cvs-logs] CVS: scummvm/sound midiparser_smf.cpp,1.18,1.19
Jamieson Christian
jamieson630 at users.sourceforge.net
Sat May 1 06:17:04 CEST 2004
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/saga isomap.cpp,1.3,1.4 isomap.h,1.3,1.4 isomap_mod.h,1.2,1.3 ite_introproc.cpp,1.6,1.7 ite_introproc.h,1.3,1.4 ite_introproc_mod.h,1.1,1.2 music.cpp,1.11,1.12 music.h,1.4,1.5 objectmap.cpp,1.5,1.6 objectmap.h,1.3,1.4 objectmap_mod.h,1.2,1.3
- Next message: [Scummvm-cvs-logs] CVS: scummvm/saga palanim.cpp,1.3,1.4 palanim.h,1.3,1.4 palanim_mod.h,1.2,1.3 reinherit.h,1.13,1.14 resnames.h,1.4,1.5 rscfile.cpp,1.3,1.4 rscfile.h,1.3,1.4 rscfile_mod.h,1.2,1.3 saga.cpp,1.14,1.15 saga.h,1.8,1.9
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/sound
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4212/scummvm/sound
Modified Files:
midiparser_smf.cpp
Log Message:
Fix for [945497] Possible bug in midiparser_smf.cpp
Corrected Type 0 SMF compression to properly account
for command lengths when Running Status is being used.
Also increased buffer size for Type 0 output since
Running Status can result in the Type 0 output being
larger than the source data. Needs some more work,
but at least the Wyrmkeep people can keep going in
the meantime.
Index: midiparser_smf.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/midiparser_smf.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- midiparser_smf.cpp 30 Apr 2004 17:48:20 -0000 1.18
+++ midiparser_smf.cpp 1 May 2004 13:16:45 -0000 1.19
@@ -47,7 +47,7 @@
static const byte command_lengths[8] = { 3, 3, 3, 3, 2, 2, 3, 0 };
-static const byte special_lengths[16] = { 0, 1, 1, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 };
+static const byte special_lengths[16] = { 0, 2, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 };
MidiParser_SMF::~MidiParser_SMF() {
if (_buffer)
@@ -217,7 +217,7 @@
}
if (midi_type == 1) {
- _buffer = (byte *) calloc (size, 1);
+ _buffer = (byte *) malloc (size);
compressToType0();
_num_tracks = 1;
_tracks[0] = _buffer;
@@ -278,12 +278,15 @@
}
// Process MIDI event.
+ bool implicitEvent = false;
copy_bytes = 0;
pos = track_pos[best_i];
do {
event = *(pos++);
- if (event < 0x80)
+ if (event < 0x80) {
event = running_status[best_i];
+ implicitEvent = true;
+ }
} while (_malformedPitchBends && (event & 0xF0) == 0xE0 && pos++);
running_status[best_i] = event;
@@ -334,6 +337,10 @@
*output++ = (byte) (delta & 0xFF);
// Write MIDI data
+ if (!implicitEvent)
+ ++track_pos[best_i];
+ --copy_bytes;
+ *output++ = running_status[best_i];
memcpy (output, track_pos[best_i], copy_bytes);
output += copy_bytes;
}
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/saga isomap.cpp,1.3,1.4 isomap.h,1.3,1.4 isomap_mod.h,1.2,1.3 ite_introproc.cpp,1.6,1.7 ite_introproc.h,1.3,1.4 ite_introproc_mod.h,1.1,1.2 music.cpp,1.11,1.12 music.h,1.4,1.5 objectmap.cpp,1.5,1.6 objectmap.h,1.3,1.4 objectmap_mod.h,1.2,1.3
- Next message: [Scummvm-cvs-logs] CVS: scummvm/saga palanim.cpp,1.3,1.4 palanim.h,1.3,1.4 palanim_mod.h,1.2,1.3 reinherit.h,1.13,1.14 resnames.h,1.4,1.5 rscfile.cpp,1.3,1.4 rscfile.h,1.3,1.4 rscfile_mod.h,1.2,1.3 saga.cpp,1.14,1.15 saga.h,1.8,1.9
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list