gst/schedulers/gstoptimalscheduler.c: Do not try to migrate decoupled elements to...
authorWim Taymans <wim.taymans@gmail.com>
Fri, 9 Jul 2004 08:25:42 +0000 (08:25 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Fri, 9 Jul 2004 08:25:42 +0000 (08:25 +0000)
Original commit message from CVS:
* gst/schedulers/gstoptimalscheduler.c:
(gst_opt_scheduler_pad_link), (group_elements_set_visited),
(element_get_reachables_func), (element_get_reachables),
(debug_element), (rechain_group), (group_migrate_connected),
(gst_opt_scheduler_pad_unlink):
Do not try to migrate decoupled elements to a new group since
they are not added to groups.

ChangeLog
gst/schedulers/gstoptimalscheduler.c

index 128c13d..ea5b940 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2004-07-09  Wim Taymans  <wim@fluendo.com>
+
+       * gst/schedulers/gstoptimalscheduler.c:
+       (gst_opt_scheduler_pad_link), (group_elements_set_visited),
+       (element_get_reachables_func), (element_get_reachables),
+       (debug_element), (rechain_group), (group_migrate_connected),
+       (gst_opt_scheduler_pad_unlink):
+       Do not try to migrate decoupled elements to a new group since
+       they are not added to groups.
+
 2004-07-08  Benjamin Otte  <otte@gnome.org>
 
        * gst/gstelement.c: (gst_element_error_func):
index e27458f..8d296e2 100644 (file)
@@ -2275,15 +2275,28 @@ group_migrate_connected (GstOptScheduler * osched, GstElement * element,
   GList *connected, *c;
   GstOptSchedulerGroup *new_group = NULL;
   GstOptSchedulerChain *chain;
+  gint len;
+
+  if (GST_ELEMENT_IS_DECOUPLED (element)) {
+    /* the element is decoupled and is therefore not in the group */
+    return NULL;
+  }
 
   GST_LOG ("migrate connected elements to new group");
   connected = element_get_reachables (element, group, brokenpad);
   GST_LOG ("elements to move to new group:");
   g_list_foreach (connected, (GFunc) debug_element, NULL);
 
-  if (g_list_length (connected) == 1) {
+  len = g_list_length (connected);
+
+  if (len == 0) {
+    g_warning ("(internal error) found lost element %s",
+        gst_element_get_name (element));
+    return NULL;
+  } else if (len == 1) {
     remove_from_group (group, GST_ELEMENT (connected->data));
     GST_LOG ("not migrating to new group as the group is empty");
+    g_list_free (connected);
     return NULL;
   }