summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>2015-08-20 17:30:38 +0100
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>2015-12-01 17:36:31 +0000
commit870c6df489238b0ad9ee988ca41e92babc9a8256 (patch)
tree5c463b8b3a75feebfc9f800122afd54ed66f1db8
parentee44337fc3e3030a5155d28b3561af157e6c6003 (diff)
decodebin: early out on pad-added when the pad is inactive
The pad may be recently deactivated if the element is switched back down very quickly. https://bugzilla.gnome.org/show_bug.cgi?id=752651
-rw-r--r--gst/playback/gstdecodebin2.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c
index dfe2ef3bb..bd02c1889 100644
--- a/gst/playback/gstdecodebin2.c
+++ b/gst/playback/gstdecodebin2.c
@@ -2880,6 +2880,12 @@ pad_added_cb (GstElement * element, GstPad * pad, GstDecodeChain * chain)
dbin = chain->dbin;
GST_DEBUG_OBJECT (pad, "pad added, chain:%p", chain);
+ GST_PAD_STREAM_LOCK (pad);
+ if (!gst_pad_is_active (pad)) {
+ GST_PAD_STREAM_UNLOCK (pad);
+ GST_DEBUG_OBJECT (pad, "Ignoring pad-added from a deactivated pad");
+ return;
+ }
caps = get_pad_caps (pad);
if (analyze_new_pad (dbin, element, pad, caps, chain, &new_chain))
@@ -2900,6 +2906,7 @@ pad_added_cb (GstElement * element, GstPad * pad, GstDecodeChain * chain)
GST_DEBUG_OBJECT (dbin, "No decode chain, new pad ignored");
}
EXPOSE_UNLOCK (dbin);
+ GST_PAD_STREAM_UNLOCK (pad);
}
static GstPadProbeReturn