diff options
author | Robin Gareus <robin@gareus.org> | 2017-09-30 13:10:17 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-09-30 13:10:17 +0200 |
commit | 697d29cdc2a59c698d2771f1dbec9a726a123843 (patch) | |
tree | 4c881401be9548227110b3f5974a57a5a958178e /libs/ardour/session_process.cc | |
parent | 61f8e53b7e88d961bffd1d8e3d4bb7cb5c7333cc (diff) |
Fix thinko in 8139becb -- route split cycle
Individual Routes cannot split the process-cycle in no_roll(); roll()
by themselves. Each of the calls will flush output buffers (and offset
port-buffers). If a route feeds another route the inputs of the other
route will only see partial data.
Diffstat (limited to 'libs/ardour/session_process.cc')
-rw-r--r-- | libs/ardour/session_process.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libs/ardour/session_process.cc b/libs/ardour/session_process.cc index a7db77c716..32c8f99734 100644 --- a/libs/ardour/session_process.cc +++ b/libs/ardour/session_process.cc @@ -311,6 +311,22 @@ Session::process_with_events (pframes_t nframes) ns = std::min ((samplecnt_t)nframes, _count_in_samples); } + boost::shared_ptr<RouteList> r = routes.reader (); + for (RouteList::iterator i = r->begin(); i != r->end(); ++i) { + samplecnt_t route_offset = (*i)->playback_latency (); + if (_remaining_latency_preroll > route_offset + ns) { + /* route will no-roll for complete pre-roll cycle */ + continue; + } + if (_remaining_latency_preroll > route_offset) { + /* route may need partial no-roll and partial roll from + * (_transport_sample - _remaining_latency_preroll) .. +ns. + * shorten and split the cycle. + */ + ns = std::min (ns, (_remaining_latency_preroll - route_offset)); + } + } + if (_count_in_samples > 0) { run_click (_transport_sample - _count_in_samples, ns); assert (_count_in_samples >= ns); |