From f6eeb474824224638dad592e4776823e633b4329 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 17 Oct 2012 15:57:53 +0000 Subject: Add a 1% speed deadzone around speed=1.0 for LTC, MTC slaves trade-off constant re-sampling to achieve sample-delta ~0, with trying to avoid resampling if the delta is within 1% of the sample-rate. git-svn-id: svn://localhost/ardour2/branches/3.0@13300 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/mtc_slave.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libs/ardour/mtc_slave.cc') diff --git a/libs/ardour/mtc_slave.cc b/libs/ardour/mtc_slave.cc index 79f985e0a2..99cb66d630 100644 --- a/libs/ardour/mtc_slave.cc +++ b/libs/ardour/mtc_slave.cc @@ -628,6 +628,12 @@ MTC_Slave::speed_and_position (double& speed, framepos_t& pos) queue_reset (false); } +#if 1 + /* provide a 1% deadzone to lock the speed */ + if (fabs(speed - 1.0) <= 0.01) + speed = 1.0; +#endif + DEBUG_TRACE (DEBUG::MTC, string_compose ("MTCsync spd: %1 pos: %2 | last-pos: %3 elapsed: %4 delta: %5\n", speed, pos, last.position, elapsed, pos - sess_pos)); -- cgit v1.2.3