summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2020-05-11 02:04:40 +0200
committerRobin Gareus <robin@gareus.org>2020-05-11 02:04:40 +0200
commita6ffc6213b92735034bd7dc39638e926bca219da (patch)
tree4fbf6140587eb95cd94230a7e3b47476c1430e24 /libs
parentf69a395893d0066380417602d04f01bfec2bb9f9 (diff)
Fix MTC latency compensation
Offset the detected timecode instead of the detection time. The latter is used by the DLL and later also used to calculate delta times which lead to a constant offset.
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/mtc_slave.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/libs/ardour/mtc_slave.cc b/libs/ardour/mtc_slave.cc
index 622e4c5309..834eb0aad1 100644
--- a/libs/ardour/mtc_slave.cc
+++ b/libs/ardour/mtc_slave.cc
@@ -157,8 +157,6 @@ MTC_TransportMaster::pre_process (MIDI::pframes_t nframes, samplepos_t now, boos
maybe_reset ();
- now += mtc_slave_latency.max;
-
_midi_port->read_and_parse_entire_midi_buffer_with_no_speed_adjustment (nframes, parser, now);
if (session_pos) {
@@ -321,7 +319,7 @@ MTC_TransportMaster::update_mtc_qtr (Parser& p, int which_qtr, samplepos_t now)
mtc_speed = (t1 - t0) / qtr_d;
DEBUG_TRACE (DEBUG::MTC, string_compose ("qtr sample DLL t0:%1 t1:%2 err:%3 spd:%4 ddt:%5\n", t0, t1, e, mtc_speed, e2 - qtr_d));
- current.update (mtc_frame, now, mtc_speed);
+ current.update (mtc_frame + mtc_slave_latency.max, now, mtc_speed);
last_inbound_frame = now;
}