summaryrefslogtreecommitdiff
path: root/libs/ardour/midi_track.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-10-22 17:05:58 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2014-10-22 17:07:11 -0400
commita289947b4f92523b8a411aedb3016390f7a82c25 (patch)
tree2148fd00949127c9103456301b7cf40a4b470245 /libs/ardour/midi_track.cc
parentbd97450ef8bfa7acf152e8f0ab7675d32db176c7 (diff)
fix timestamps for immediate MIDI events to deal with split process cycle conditions
Diffstat (limited to 'libs/ardour/midi_track.cc')
-rw-r--r--libs/ardour/midi_track.cc10
1 files 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