summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@bilboed.com>2007-02-20 15:44:32 +0000
committerEdward Hervey <bilboed@bilboed.com>2007-02-20 15:44:32 +0000
commit7bc6fc07a133db45b1276380339da181df8ff086 (patch)
tree3657738698bf9cfe88e73a8e17ad9f1d8c3ae78c /gst
parent7746c2f1761d77eeb596d97c21b34334373b49f0 (diff)
downloadgstreamer-plugins-base-7bc6fc07a133db45b1276380339da181df8ff086.tar.gz
gst/playback/gstdecodebin2.c: Don't free groups from the streaming threads. Just put them aside and free them in disp...
Original commit message from CVS: * gst/playback/gstdecodebin2.c: (gst_decode_bin_dispose), (multi_queue_underrun_cb), (gst_decode_group_check_if_drained), (sort_end_pads), (gst_decode_group_expose), (gst_decode_group_hide): Don't free groups from the streaming threads. Just put them aside and free them in dispose.
Diffstat (limited to 'gst')
-rw-r--r--gst/playback/gstdecodebin2.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c
index bda175369..399c60dd4 100644
--- a/gst/playback/gstdecodebin2.c
+++ b/gst/playback/gstdecodebin2.c
@@ -71,6 +71,8 @@ struct _GstDecodeBin
GstDecodeGroup *activegroup; /* group currently active */
GList *groups; /* List of non-active GstDecodeGroups, sorted in
* order of creation. */
+ GList *oldgroups; /* List of no-longer-used GstDecodeGroups.
+ * Should be freed in dispose */
gint nbpads; /* unique identifier for source pads */
GstCaps *caps; /* caps on which to stop decoding */
@@ -497,6 +499,14 @@ gst_decode_bin_dispose (GObject * object)
g_list_free (decode_bin->groups);
decode_bin->groups = NULL;
+ for (tmp = decode_bin->oldgroups; tmp; tmp = g_list_next (tmp)) {
+ GstDecodeGroup *group = (GstDecodeGroup *) tmp->data;
+
+ gst_decode_group_free (group);
+ }
+ g_list_free (decode_bin->oldgroups);
+ decode_bin->oldgroups = NULL;
+
if (decode_bin->caps)
gst_caps_unref (decode_bin->caps);
decode_bin->caps = NULL;
@@ -1269,7 +1279,6 @@ multi_queue_underrun_cb (GstElement * queue, GstDecodeGroup * group)
GST_DEBUG_OBJECT (dbin, "Switching to new group");
/* unexpose current active */
gst_decode_group_hide (group);
- gst_decode_group_free (group);
/* expose first group of groups */
gst_decode_group_expose ((GstDecodeGroup *) dbin->groups->data);
@@ -1518,7 +1527,6 @@ gst_decode_group_check_if_drained (GstDecodeGroup * group)
GST_DEBUG_OBJECT (dbin, "Switching to new group");
gst_decode_group_hide (group);
- gst_decode_group_free (group);
gst_decode_group_expose ((GstDecodeGroup *) dbin->groups->data);
}
@@ -1704,6 +1712,7 @@ gst_decode_group_hide (GstDecodeGroup * group)
GROUP_MUTEX_UNLOCK (group);
group->dbin->activegroup = NULL;
+ group->dbin->oldgroups = g_list_append (group->dbin->oldgroups, group);
}
static void