summaryrefslogtreecommitdiffstats
path: root/gst
diff options
context:
space:
mode:
authorSebastian Dröge <slomo@circular-chaos.org>2008-06-03 14:35:59 +0000
committerSebastian Dröge <slomo@circular-chaos.org>2008-06-03 14:35:59 +0000
commit38e6e8ed8f44669c51f58ac46f14f43c243bf887 (patch)
tree0c0db99d85b5bdc5f35eb928b4ab2ece79b77184 /gst
parent10d104fcaee69109357bdefabca69cffeb01638c (diff)
downloadgst-plugins-bad-38e6e8ed8f44669c51f58ac46f14f43c243bf887.tar.gz
gst-plugins-bad-38e6e8ed8f44669c51f58ac46f14f43c243bf887.tar.bz2
gst-plugins-bad-38e6e8ed8f44669c51f58ac46f14f43c243bf887.zip
gst/interleave/interleave.c: Stop GstCollectPads before calling the parent's state change function when going from PA...
Original commit message from CVS: * gst/interleave/interleave.c: (gst_interleave_pad_get_type), (gst_interleave_change_state): Stop GstCollectPads before calling the parent's state change function when going from PAUSED to READY as we otherwise deadlock. Fixes bug #536258.
Diffstat (limited to 'gst')
-rw-r--r--gst/interleave/interleave.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gst/interleave/interleave.c b/gst/interleave/interleave.c
index d693da82..bda27be1 100644
--- a/gst/interleave/interleave.c
+++ b/gst/interleave/interleave.c
@@ -153,7 +153,7 @@ gst_interleave_pad_get_type (void)
{
static GType type = 0;
- if (!type) {
+ if (G_UNLIKELY (type == 0)) {
static const GTypeInfo info = {
sizeof (GstPadClass),
NULL,
@@ -171,7 +171,6 @@ gst_interleave_pad_get_type (void)
return type;
}
-
GST_BOILERPLATE (GstInterleave, gst_interleave, GstElement, GST_TYPE_ELEMENT);
enum
@@ -614,13 +613,19 @@ gst_interleave_change_state (GstElement * element, GstStateChange transition)
break;
}
+ /* Stop before calling the parent's state change function as
+ * GstCollectPads might take locks and we would deadlock in that
+ * case
+ */
+ if (transition == GST_STATE_CHANGE_PAUSED_TO_READY)
+ gst_collect_pads_stop (self->collect);
+
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
switch (transition) {
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
- gst_collect_pads_stop (self->collect);
gst_pad_set_caps (self->src, NULL);
gst_caps_replace (&self->sinkcaps, NULL);
break;