From 63db8dfb6735f34983a736f7ac5a264ff354dfcd Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 28 Mar 2003 17:29:57 +0000 Subject: [PATCH] - enable chain if an active group is added to it Original commit message from CVS: - enable chain if an active group is added to it - enable group if a PLAYING element is added to it --- gst/schedulers/gstoptimalscheduler.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gst/schedulers/gstoptimalscheduler.c b/gst/schedulers/gstoptimalscheduler.c index 3290a4af27..0b6df2768d 100644 --- a/gst/schedulers/gstoptimalscheduler.c +++ b/gst/schedulers/gstoptimalscheduler.c @@ -172,7 +172,11 @@ static GstOptSchedulerGroup* ref_group_by_count (GstOptSchedulerGroup *group, #endif static GstOptSchedulerGroup* unref_group (GstOptSchedulerGroup *group); static void destroy_group (GstOptSchedulerGroup *group); +static void group_element_set_enabled (GstOptSchedulerGroup *group, + GstElement *element, gboolean enabled); +static void chain_group_set_enabled (GstOptSchedulerChain *chain, + GstOptSchedulerGroup *group, gboolean enabled); /* * Scheduler private data for an element */ @@ -425,6 +429,10 @@ add_to_chain (GstOptSchedulerChain *chain, GstOptSchedulerGroup *group) chain->groups = g_slist_prepend (chain->groups, group); chain->num_groups++; + if (GST_OPT_SCHEDULER_GROUP_IS_ENABLED (group)) { + chain_group_set_enabled (chain, group, TRUE); + } + return chain; } @@ -587,6 +595,10 @@ add_to_group (GstOptSchedulerGroup *group, GstElement *element) group->elements = g_slist_prepend (group->elements, element); group->num_elements++; + if (gst_element_get_state (element) == GST_STATE_PLAYING) { + group_element_set_enabled (group, element, TRUE); + } + return group; }