diff options
author | Robin Gareus <robin@gareus.org> | 2012-10-17 15:57:53 +0000 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2012-10-17 15:57:53 +0000 |
commit | f6eeb474824224638dad592e4776823e633b4329 (patch) | |
tree | ff7a67b450d4a3a46e6f4c5963f28d13cf6197d7 /libs/ardour/mtc_slave.cc | |
parent | c4cb4fa1417bd2c19654e449b285b171e2130eca (diff) |
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
Diffstat (limited to 'libs/ardour/mtc_slave.cc')
-rw-r--r-- | libs/ardour/mtc_slave.cc | 6 |
1 files changed, 6 insertions, 0 deletions
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)); |