From d5f0f798ac4edbc581e3d48d915769187b33ebc7 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 22 Jul 2004 09:43:40 +0000 Subject: [PATCH] gst/schedulers/gstoptimalscheduler.c: fix 147894-2 and the group_link problem. Original commit message from CVS: * gst/schedulers/gstoptimalscheduler.c: (remove_from_group), (gst_opt_scheduler_pad_link): fix 147894-2 and the group_link problem. --- ChangeLog | 6 ++++++ gst/schedulers/gstoptimalscheduler.c | 10 +++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6a7661cc6a..1fb94574a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-07-22 Wim Taymans + + * gst/schedulers/gstoptimalscheduler.c: (remove_from_group), + (gst_opt_scheduler_pad_link): + fix 147894-2 and the group_link problem. + 2004-07-22 Wim Taymans * testsuite/schedulers/147894-2.c: (queue_empty), (queue_filled), diff --git a/gst/schedulers/gstoptimalscheduler.c b/gst/schedulers/gstoptimalscheduler.c index 667adaa7d7..465bd2604b 100644 --- a/gst/schedulers/gstoptimalscheduler.c +++ b/gst/schedulers/gstoptimalscheduler.c @@ -915,6 +915,10 @@ remove_from_group (GstOptSchedulerGroup * group, GstElement * element) * this element */ group_dec_links_for_element (group, element); + if (gst_element_get_state (element) == GST_STATE_PLAYING) { + group_element_set_enabled (group, element, FALSE); + } + group->elements = g_slist_remove (group->elements, element); group->num_elements--; @@ -2117,7 +2121,7 @@ gst_opt_scheduler_pad_link (GstScheduler * sched, GstPad * srcpad, if (!group1) { /* create a new group for src_element as it cannot be merged into another group * here. we create the group in the same chain as the loop-based element. note - * that creating a new group will also increment the links with other groups */ + * that creating a new group will not increment the links with other groups */ GST_DEBUG ("creating new group for element %s", GST_ELEMENT_NAME (src_element)); group1 = @@ -2127,9 +2131,9 @@ gst_opt_scheduler_pad_link (GstScheduler * sched, GstPad * srcpad, /* both elements are already in a group, make sure they are added to * the same chain */ merge_chains (group1->chain, group2->chain); - /* increment the group link counters */ - group_inc_link (group1, group2); } + /* increment the group link counters */ + group_inc_link (group1, group2); break; } case GST_OPT_INVALID: