From add97dd1cef2226bf64e09e42a69dbe3b470700d Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Tue, 20 Jul 2004 10:40:09 +0000 Subject: [PATCH] fix for #147819 (Add some checks in the opt scheduler) Original commit message from CVS: fix for #147819 (Add some checks in the opt scheduler) --- ChangeLog | 11 +++++++++++ gst/schedulers/gstoptimalscheduler.c | 15 ++++++++++----- tests/old/testsuite/schedulers/Makefile.am | 4 ++-- testsuite/schedulers/Makefile.am | 4 ++-- 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index b199f926ee..5d627963ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2004-07-20 Thomas Vander Stichele + + 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 patch by: Benjamin Otte diff --git a/gst/schedulers/gstoptimalscheduler.c b/gst/schedulers/gstoptimalscheduler.c index ac2a0e2d5f..92969bdcd9 100644 --- a/gst/schedulers/gstoptimalscheduler.c +++ b/gst/schedulers/gstoptimalscheduler.c @@ -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; diff --git a/tests/old/testsuite/schedulers/Makefile.am b/tests/old/testsuite/schedulers/Makefile.am index 5ca979cde0..147b59446a 100644 --- a/tests/old/testsuite/schedulers/Makefile.am +++ b/tests/old/testsuite/schedulers/Makefile.am @@ -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 diff --git a/testsuite/schedulers/Makefile.am b/testsuite/schedulers/Makefile.am index 5ca979cde0..147b59446a 100644 --- a/testsuite/schedulers/Makefile.am +++ b/testsuite/schedulers/Makefile.am @@ -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