From a289947b4f92523b8a411aedb3016390f7a82c25 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 22 Oct 2014 17:05:58 -0400 Subject: [PATCH] fix timestamps for immediate MIDI events to deal with split process cycle conditions --- libs/ardour/midi_track.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/ardour/midi_track.cc b/libs/ardour/midi_track.cc index 0dab684ac2..cf04094015 100644 --- a/libs/ardour/midi_track.cc +++ b/libs/ardour/midi_track.cc @@ -536,12 +536,12 @@ MidiTrack::write_out_of_band_data (BufferSet& bufs, framepos_t /*start*/, framep * the last argument ("stop on overflow in destination") so that we'll * ship the rest out next time. * - * the (nframes-1) argument puts all these events at the last + * the Port::port_offset() + (nframes-1) argument puts all these events at the last * possible position of the output buffer, so that we do not - * violate monotonicity when writing. + * violate monotonicity when writing. Port::port_offset() will + * be non-zero if we're in a split process cycle. */ - - _immediate_events.read (buf, 0, 1, nframes-1, true); + _immediate_events.read (buf, 0, 1, Port::port_offset() + nframes - 1, true); } } @@ -619,7 +619,7 @@ MidiTrack::write_immediate_event(size_t size, const uint8_t* buf) return false; } const uint32_t type = EventTypeMap::instance().midi_event_type(buf[0]); - return (_immediate_events.write(0, type, size, buf) == size); + return (_immediate_events.write (0, type, size, buf) == size); } void