From 3c446a52753b1575b7e4a65cdf02efca01f5cdad Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 14 Nov 2019 21:50:00 +0100 Subject: [PATCH] Fix cycle-end position when not rolling When stopped start_sample == end_sample. This fixes accidental automation lookup, as well as plugin time/position information. --- libs/ardour/plugin_insert.cc | 4 ++-- libs/ardour/session_process.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc index 24b5dfd8ad..94f7ee4cbb 100644 --- a/libs/ardour/plugin_insert.cc +++ b/libs/ardour/plugin_insert.cc @@ -1294,7 +1294,7 @@ PluginInsert::automate_and_run (BufferSet& bufs, samplepos_t start, samplepos_t samplecnt_t cnt = min (((samplecnt_t) ceil (next_event.when) - start), (samplecnt_t) nframes); - connect_and_run (bufs, start, start + cnt, speed, cnt, offset, true); // XXX (start + cnt) * speed + connect_and_run (bufs, start, start + cnt * speed, speed, cnt, offset, true); nframes -= cnt; offset += cnt; @@ -1310,7 +1310,7 @@ PluginInsert::automate_and_run (BufferSet& bufs, samplepos_t start, samplepos_t /* cleanup anything that is left to do */ if (nframes) { - connect_and_run (bufs, start, start + nframes, speed, nframes, offset, true); + connect_and_run (bufs, start, start + nframes * speed, speed, nframes, offset, true); } } diff --git a/libs/ardour/session_process.cc b/libs/ardour/session_process.cc index 28aa7b1441..28cb8a6fd9 100644 --- a/libs/ardour/session_process.cc +++ b/libs/ardour/session_process.cc @@ -166,7 +166,7 @@ Session::no_roll (pframes_t nframes) { PT_TIMING_CHECK (4); - samplepos_t end_sample = _transport_sample + nframes; // FIXME: varispeed + no_roll ?? + samplepos_t end_sample = _transport_sample + floor (nframes * _transport_speed); int ret = 0; boost::shared_ptr r = routes.reader ();