fix for #147819 (Add some checks in the opt scheduler)
authorThomas Vander Stichele <thomas@apestaart.org>
Tue, 20 Jul 2004 10:40:09 +0000 (10:40 +0000)
committerThomas Vander Stichele <thomas@apestaart.org>
Tue, 20 Jul 2004 10:40:09 +0000 (10:40 +0000)
Original commit message from CVS:
fix for #147819 (Add some checks in the opt scheduler)

ChangeLog
gst/schedulers/gstoptimalscheduler.c
tests/old/testsuite/schedulers/Makefile.am
testsuite/schedulers/Makefile.am

index b199f92..5d62796 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2004-07-20  Thomas Vander Stichele  <thomas at apestaart dot org>
 
+       patch by: Wim Taymans
+
+       * gst/schedulers/gstoptimalscheduler.c: (group_has_element),
+       (gst_opt_scheduler_schedule_run_queue),
+       (gst_opt_scheduler_get_wrapper), (get_group),
+       (group_migrate_connected):
+       * testsuite/schedulers/Makefile.am:
+         fix for #147819 (Add some checks in the opt scheduler)
+
+2004-07-20  Thomas Vander Stichele  <thomas at apestaart dot org>
+
        patch by: Benjamin Otte
 
        * gst/gstelementfactory.c: (__gst_element_details_set):
index ac2a0e2..92969bd 100644 (file)
@@ -234,6 +234,7 @@ static void group_error_handler (GstOptSchedulerGroup * group);
 static void group_element_set_enabled (GstOptSchedulerGroup * group,
     GstElement * element, gboolean enabled);
 static gboolean schedule_group (GstOptSchedulerGroup * group);
+static void get_group (GstElement * element, GstOptSchedulerGroup ** group);
 
 
 /* 
@@ -1203,7 +1204,13 @@ gst_opt_scheduler_schedule_run_queue (GstOptScheduler * osched)
 
     GST_LOG_OBJECT (osched, "scheduling group %p", group);
 
-    res = schedule_group (group);
+    if (GST_OPT_SCHEDULER_GROUP_IS_ENABLED (group)) {
+      res = schedule_group (group);
+    } else {
+      GST_INFO_OBJECT (osched,
+          "group was disabled while it was on the queue, not scheduling");
+      res = TRUE;
+    }
     if (!res) {
       g_warning ("error scheduling group %p", group);
       group_error_handler (group);
@@ -1419,10 +1426,10 @@ gst_opt_scheduler_get_wrapper (GstPad * srcpad)
   GST_LOG ("need to schedule the peer element");
 
   /* else we need to schedule the peer element */
-  group = GST_ELEMENT_SCHED_GROUP (GST_PAD_PARENT (srcpad));
+  get_group (GST_PAD_PARENT (srcpad), &group);
   if (group == NULL) {
     /* wow, peer has no group */
-    g_warning ("peer without group detected");
+    GST_LOG ("peer without group detected");
     //group_error_handler (group);
     return GST_DATA (gst_event_new (GST_EVENT_INTERRUPT));
   }
@@ -1610,8 +1617,6 @@ get_group (GstElement * element, GstOptSchedulerGroup ** group)
 {
   GstOptSchedulerCtx *ctx;
 
-  /*GList *pads; */
-
   ctx = GST_ELEMENT_SCHED_CONTEXT (element);
   if (ctx)
     *group = ctx->group;
index 5ca979c..147b594 100644 (file)
@@ -4,12 +4,12 @@ tests_pass = \
        unlink_src unlink_sink \
        relink_src relink_sink \
        unref_src unref_sink \
-       143777 143777-2 147713 147894
+       143777 143777-2 147713 147819 147894
 
 # don't enable this one unless it actually works.
 #      useless_iteration
 
-tests_fail = 142183 142183-2 147819
+tests_fail = 142183 142183-2
 tests_ignore =
 
 unlink_src_SOURCES = unlink.c
index 5ca979c..147b594 100644 (file)
@@ -4,12 +4,12 @@ tests_pass = \
        unlink_src unlink_sink \
        relink_src relink_sink \
        unref_src unref_sink \
-       143777 143777-2 147713 147894
+       143777 143777-2 147713 147819 147894
 
 # don't enable this one unless it actually works.
 #      useless_iteration
 
-tests_fail = 142183 142183-2 147819
+tests_fail = 142183 142183-2
 tests_ignore =
 
 unlink_src_SOURCES = unlink.c