Skip to content

Commit 7af1262

Browse files
committed
Fix the writing of the MIDI files to interchange/.../midifiles
1 parent 900db61 commit 7af1262

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

libs/ardour/smf_source.cc

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -814,17 +814,8 @@ SMFSource::load_model_unlocked (bool force_reload)
814814
0x51/0x58/0x59 are handled by the TempoMap,
815815
0x2F (End of Track) is structural,
816816
0x7F (Sequencer-Specific) carries Ardour note IDs.
817-
818-
read_event() sets size to the actual event data
819-
length for non-0x7F meta events. For 0x7F events
820-
(Ardour note IDs, unknown sequencer-specific), it
821-
does NOT update size, so we must guard with
822-
buf[0] == 0xFF to avoid using stale buffer data
823-
with an inflated scratch_size.
824817
*/
825818
if (size >= 2 && buf[0] == 0xFF && buf[1] >= 0x01 && buf[1] <= 0x09) {
826-
/* size here is the actual event length set by
827-
read_event(), not the scratch buffer capacity */
828819
const Temporal::Beats event_time = Temporal::Beats::ticks_at_rate (time, ppqn());
829820
eventlist.push_back (make_pair (
830821
new Evoral::Event<Temporal::Beats> (

libs/evoral/SMF.cc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -358,16 +358,9 @@ SMF::read_event(uint32_t* delta_t, uint32_t* bufsize, uint8_t** buf, event_id_t*
358358

359359
if (smf_extract_vlq (&event->midi_buffer[4+lenlen], event->midi_buffer_length-(4+lenlen), &id, &idlen) == 0) {
360360
*note_id = id;
361-
return 0;
362361
}
363362
}
364363
}
365-
366-
/* We do not return sequencer-specific events
367-
* that are not known to us.
368-
*/
369-
370-
return 0;
371364
}
372365

373366
is_meta = true;

0 commit comments

Comments
 (0)