summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-11-09 17:43:52 +0000
committerCarl Hetherington <carl@carlh.net>2011-11-09 17:43:52 +0000
commit0ed06420c2364a038f9909255bda93d2d134d5cc (patch)
tree652b574301f4e2c699d1bdfe71eb71e2101ef6c1 /libs/ardour
parent9a734cd4b843440840449ef43ffb6c5e86275c0a (diff)
Return 0 from the topological sort if it failed due to
feedback. git-svn-id: svn://localhost/ardour2/branches/3.0@10509 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/route_dag.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/libs/ardour/route_dag.cc b/libs/ardour/route_dag.cc
index 6a6e8d2bbd..3b13cf9415 100644
--- a/libs/ardour/route_dag.cc
+++ b/libs/ardour/route_dag.cc
@@ -146,7 +146,9 @@ struct RouteRecEnabledComparator
}
};
-
+/** Perform a topological sort of a list of routes using a directed graph representing connections.
+ * @return Sorted list of routes, or 0 if the graph contains cycles (feedback loops).
+ */
boost::shared_ptr<RouteList>
ARDOUR::topological_sort (
boost::shared_ptr<RouteList> routes,
@@ -189,7 +191,8 @@ ARDOUR::topological_sort (
}
if (!edges.empty ()) {
- cout << "Feedback detected.\n";
+ /* There are cycles in the graph, so we can't do a topological sort */
+ return boost::shared_ptr<RouteList> ();
}
return sorted_routes;