13
0

triggerbox: fix lack of alignment after a locate.

Triggerboxen were being executed during the latency preroll phase, which is
inappropriate. ::fast_forward() will prepare them to run at precisely the
correct time. So we add an explicit clause to avoid this.
This commit is contained in:
Paul Davis 2022-08-08 09:08:48 -06:00
parent 20c942bb48
commit d65bc2a798

View File

@ -537,10 +537,21 @@ Route::process_output_buffers (BufferSet& bufs,
}
}
if (speed < 0) {
(*i)->run (bufs, start_sample + latency, end_sample + latency, pspeed, nframes, *i != _processors.back());
} else {
(*i)->run (bufs, start_sample - latency, end_sample - latency, pspeed, nframes, *i != _processors.back());
/* run_disk_reader being false means we are still inside
* latency_preroll, and during this time we do not want to run
* the triggerbox at all. The disk reader looks at the speed
* (pspeed) that was reset to zero as a indication of how it
* should behave. The triggerbox is not speed-sensitive in the
* same way, so we need a more explicit test here to avoid
* running it.
*/
if (run_disk_reader || ((*i) != _triggerbox)) {
if (speed < 0) {
(*i)->run (bufs, start_sample + latency, end_sample + latency, pspeed, nframes, *i != _processors.back());
} else {
(*i)->run (bufs, start_sample - latency, end_sample - latency, pspeed, nframes, *i != _processors.back());
}
}
bufs.set_count ((*i)->output_streams());