+2004-05-04 Wim Taymans <wim@fluendo.com>
+
+ * gst/schedulers/gstoptimalscheduler.c: (remove_from_group),
+ (group_dec_link), (gst_opt_scheduler_pad_unlink):
+ when removing an element from a group, we always need to
+ decrement the link count that this group had with other
+ groups through the element.
+ added an extra assert to catch inconsistencies when decrementing
+ the link count.
+
2004-05-04 Thomas Vander Stichele <thomas at apestaart dot org>
* configure.ac:
GstElement * element);
static GstOptSchedulerGroup *remove_from_group (GstOptSchedulerGroup * group,
GstElement * element);
+static void group_dec_links_for_element (GstOptSchedulerGroup * group,
+ GstElement * element);
static GstOptSchedulerGroup *merge_groups (GstOptSchedulerGroup * group1,
GstOptSchedulerGroup * group2);
static void setup_group_scheduler (GstOptScheduler * osched,
g_assert (element != NULL);
g_assert (GST_ELEMENT_SCHED_GROUP (element) == group);
+ /* first decrement the links that this group has with other groups through
+ * this element */
+ group_dec_links_for_element (group, element);
+
group->elements = g_slist_remove (group->elements, element);
group->num_elements--;
links = g_slist_next (links);
if (IS_GROUP_LINK (link, group1, group2)) {
+ g_assert (link->count > 0);
link->count--;
GST_LOG ("link count between %p and %p is now %d",
group1, group2, link->count);
return reachable;
}
+/*
+ * Go through all the pads of the given element and decrement the links that
+ * this group has with the group of the element. This function is mainly used
+ * to update the group connections before we remove element from the group.
+ */
static void
group_dec_links_for_element (GstOptSchedulerGroup * group, GstElement * element)
{
}
if (linkcount < 2) {
- group_dec_links_for_element (group, element);
remove_from_group (group, element);
}
/* if linkcount == 2, it will be unlinked later on */
!GST_ELEMENT_IS_DECOUPLED (src_element)) {
GST_LOG ("el ement1 is separated from the group");
- /* have to decrement links to other groups from other pads */
- group_dec_links_for_element (group, src_element);
remove_from_group (group, src_element);
} else {
GST_LOG ("src_element is decoupled or entry in loop based group");
!GST_ELEMENT_IS_DECOUPLED (sink_element)) {
GST_LOG ("sink_element is separated from the group");
- /* have to decrement links to other groups from other pads */
- group_dec_links_for_element (group, sink_element);
remove_from_group (group, sink_element);
} else {
GST_LOG ("sink_element is decoupled or entry in loop based group");