- _worst_track_latency = 0;
- ptw = post_transport_work();
-
- DEBUG_TRACE(DEBUG::Latency, "---------------------------- update latency\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)->output()->signal_latency ();
- framecnt_t track_latency = (*i)->update_total_latency ();
-
- if (old_latency != track_latency) {
-#ifndef HAVE_JACK_NEW_LATENCY
- (*i)->input()->update_port_total_latencies ();
- (*i)->output()->update_port_total_latencies ();
-#endif
- update_jack = true;
- }
-
- if (!(*i)->is_hidden() && ((*i)->active())) {
- _worst_track_latency = max (_worst_track_latency, track_latency);
- }
- }
-
- if (update_jack) {
- _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_delay (_worst_track_latency);
- }
-
- set_worst_io_latencies ();