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.
This commit is contained in:
Sebastian Dröge 2008-06-03 14:35:59 +00:00
parent 10d104fcae
commit 38e6e8ed8f
2 changed files with 16 additions and 3 deletions

View File

@ -1,3 +1,11 @@
2008-06-03 Sebastian Dröge <slomo@circular-chaos.org>
* 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.
2008-06-03 Wim Taymans <wim.taymans@collabora.co.uk> 2008-06-03 Wim Taymans <wim.taymans@collabora.co.uk>
* gst/h264parse/gsth264parse.c: (gst_nal_bs_init), * gst/h264parse/gsth264parse.c: (gst_nal_bs_init),

View File

@ -153,7 +153,7 @@ gst_interleave_pad_get_type (void)
{ {
static GType type = 0; static GType type = 0;
if (!type) { if (G_UNLIKELY (type == 0)) {
static const GTypeInfo info = { static const GTypeInfo info = {
sizeof (GstPadClass), sizeof (GstPadClass),
NULL, NULL,
@ -171,7 +171,6 @@ gst_interleave_pad_get_type (void)
return type; return type;
} }
GST_BOILERPLATE (GstInterleave, gst_interleave, GstElement, GST_TYPE_ELEMENT); GST_BOILERPLATE (GstInterleave, gst_interleave, GstElement, GST_TYPE_ELEMENT);
enum enum
@ -614,13 +613,19 @@ gst_interleave_change_state (GstElement * element, GstStateChange transition)
break; 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); ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
switch (transition) { switch (transition) {
case GST_STATE_CHANGE_PLAYING_TO_PAUSED: case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
break; break;
case GST_STATE_CHANGE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
gst_collect_pads_stop (self->collect);
gst_pad_set_caps (self->src, NULL); gst_pad_set_caps (self->src, NULL);
gst_caps_replace (&self->sinkcaps, NULL); gst_caps_replace (&self->sinkcaps, NULL);
break; break;