diff options
author | Robin Gareus <robin@gareus.org> | 2019-11-18 15:10:15 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-11-18 15:55:32 +0100 |
commit | 3cf888498a9837be4cf19394fe554d1cdb9efde5 (patch) | |
tree | 197fb5669822349ff6e2a58f5e3fed917db486ee /libs/ardour/plugin_insert.cc | |
parent | 3b2b946d4e95412c4e365319f411022afad6eece (diff) |
Fix automation lookup when rolling backwards
Diffstat (limited to 'libs/ardour/plugin_insert.cc')
-rw-r--r-- | libs/ardour/plugin_insert.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc index 94f7ee4cbb..9b4aa17b0c 100644 --- a/libs/ardour/plugin_insert.cc +++ b/libs/ardour/plugin_insert.cc @@ -1292,13 +1292,14 @@ PluginInsert::automate_and_run (BufferSet& bufs, samplepos_t start, samplepos_t while (nframes) { - samplecnt_t cnt = min (((samplecnt_t) ceil (next_event.when) - start), (samplecnt_t) nframes); + samplecnt_t cnt = min ((samplecnt_t) ceil (fabs (next_event.when - start)), (samplecnt_t) nframes); + assert (cnt > 0); connect_and_run (bufs, start, start + cnt * speed, speed, cnt, offset, true); nframes -= cnt; offset += cnt; - start += cnt; + start += cnt * speed; map_loop_range (start, end); |