- if (_state_of_the_state & Deletion) {
- return;
- }
-
- _worst_track_latency = 0;
- ptw = post_transport_work();
-
- DEBUG_TRACE(DEBUG::Latency, "---------------------------- update latency compensation\n\n")
-
- boost::shared_ptr<RouteList> r = routes.reader ();
-
- for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
-
- if (with_stop) {
- (*i)->nonrealtime_handle_transport_stopped (abort, (ptw & PostTransportLocate), (!(ptw & PostTransportLocate) || pending_locate_flush));
- }
-
- framecnt_t old_latency = (*i)->signal_latency ();
- framecnt_t new_latency = (*i)->update_signal_latency ();
-
- if (old_latency != new_latency) {
- update_jack = true;
- }
-
- if (!(*i)->is_hidden() && ((*i)->active())) {
- _worst_track_latency = max (_worst_track_latency, new_latency);
- }
- }
-
- if (force_whole_graph || update_jack) {
- /* trigger a full recompute of latency numbers for the graph
- */
- _engine.update_total_latencies ();
- }
-
- DEBUG_TRACE(DEBUG::Latency, string_compose("worst case route internal latency was %1\n", _worst_track_latency));
-
- for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
- (*i)->set_latency_compensation (_worst_track_latency);
- }
-
- set_worst_io_latencies ();
-
- /* reflect any changes in latencies into capture offsets
- */
-
- boost::shared_ptr<RouteList> rl = routes.reader();
- for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
- boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i);
- if (tr) {
- tr->set_capture_offset ();
- }
- }
- DEBUG_TRACE(DEBUG::Latency, "---------------------------- DONE update latency compensation\n\n")