From 948fd683cdb2e6fca0c096e2941f28e4bc82a496 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 22 Oct 2012 17:34:15 +0000 Subject: MTC slave - fix jumps on initialization Do not re-position transport before first full frame has arrived. git-svn-id: svn://localhost/ardour2/branches/3.0@13317 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/mtc_slave.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libs') diff --git a/libs/ardour/mtc_slave.cc b/libs/ardour/mtc_slave.cc index 8baddc3efc..305b12186f 100644 --- a/libs/ardour/mtc_slave.cc +++ b/libs/ardour/mtc_slave.cc @@ -243,6 +243,7 @@ MTC_Slave::update_mtc_qtr (Parser& /*p*/, int which_qtr, framepos_t now) mtc_frame += qtr * transport_direction; DEBUG_TRACE (DEBUG::MTC, string_compose ("qtr frame %1 at %2 -> mtc_frame: %3\n", which_qtr, now, mtc_frame)); + framepos_t ts = 0; double mtc_speed = 0; if (first_mtc_timestamp != 0) { @@ -253,12 +254,13 @@ MTC_Slave::update_mtc_qtr (Parser& /*p*/, int which_qtr, framepos_t now) e2 += c * e; mtc_speed = (t1 - t0) / qtr_d; + ts = now; DEBUG_TRACE (DEBUG::MTC, string_compose ("qtr frame DLL t0:%1 t1:%2 err:%3 spd:%4 ddt:%5\n", t0, t1, e, mtc_speed, e2 - qtr_d)); } current.guard1++; current.position = mtc_frame; - current.timestamp = now; + current.timestamp = ts; current.speed = mtc_speed; current.guard2++; -- cgit v1.2.3