diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-09-28 13:19:15 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-09-28 13:19:15 +0000 |
commit | 9030f4e61b9a2a7dc0f8d31d22e9f01047c0e70f (patch) | |
tree | a6e285430a942e4d08db65e42f14594f3656caf8 /libs/ardour/route.cc | |
parent | 7fdc1272b25b6f170da6f34d4386f9d27e9f7a17 (diff) |
forward port latency computation fix from 2.X for case where a route has no connections
git-svn-id: svn://localhost/ardour2/branches/3.0@10155 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/route.cc')
-rw-r--r-- | libs/ardour/route.cc | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index e64f21636c..cee897b119 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -3544,21 +3544,26 @@ Route::update_port_latencies (PortSet& from, PortSet& to, bool playback, framecn jack_latency_range_t all_connections; - all_connections.min = ~((jack_nframes_t) 0); - all_connections.max = 0; - - /* iterate over all "from" ports and determine the latency range for all of their - connections to the "outside" (outside of this Route). - */ - - for (PortSet::iterator p = from.begin(); p != from.end(); ++p) { - - jack_latency_range_t range; - - p->get_connected_latency_range (range, playback); - - all_connections.min = min (all_connections.min, range.min); - all_connections.max = max (all_connections.max, range.max); + if (from.empty()) { + all_connections.min = 0; + all_connections.max = 0; + } else { + all_connections.min = ~((jack_nframes_t) 0); + all_connections.max = 0; + + /* iterate over all "from" ports and determine the latency range for all of their + connections to the "outside" (outside of this Route). + */ + + for (PortSet::iterator p = from.begin(); p != from.end(); ++p) { + + jack_latency_range_t range; + + p->get_connected_latency_range (range, playback); + + all_connections.min = min (all_connections.min, range.min); + all_connections.max = max (all_connections.max, range.max); + } } /* set the "from" port latencies to the max/min range of all their connections */ |