summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2016-12-06 16:29:23 +0200
committerSebastian Dröge <sebastian@centricular.com>2016-12-07 11:19:46 +0200
commit5b873a9bec5f93100160ce1e4aa02a32351a265d (patch)
tree84fd19247d800bead7fa90bd095193c8f9976e55
parentfaac1d7089a58e56abff44242feba3edff42ff2e (diff)
downloadgstreamer-plugins-base-5b873a9bec5f93100160ce1e4aa02a32351a265d.tar.gz
tagdemux: Fix crash when shutting down element during getrange()
Ensure that nothing is in any of the streaming thread functions anymore when going from PAUSED to READY. While the parent's state change function has deactivated all pads, there is nothing preventing downstream from activating our srcpad again and calling the getrange() function. Although we're in READY! https://bugzilla.gnome.org/show_bug.cgi?id=775687
-rw-r--r--gst-libs/gst/tag/gsttagdemux.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gst-libs/gst/tag/gsttagdemux.c b/gst-libs/gst/tag/gsttagdemux.c
index f0e685d2b..124f7887f 100644
--- a/gst-libs/gst/tag/gsttagdemux.c
+++ b/gst-libs/gst/tag/gsttagdemux.c
@@ -1726,11 +1726,19 @@ gst_tag_demux_change_state (GstElement * element, GstStateChange transition)
switch (transition) {
case GST_STATE_CHANGE_PAUSED_TO_READY:
+ /* Ensure that nothing is in any of the streaming thread functions
+ * anymore. While the above has deactivated all pads, there is nothing
+ * preventing downstream from activating our srcpad again and calling the
+ * getrange() function. Although we're in READY!
+ */
+ GST_PAD_STREAM_LOCK (demux->priv->srcpad);
gst_tag_demux_reset (demux);
+ GST_PAD_STREAM_UNLOCK (demux->priv->srcpad);
break;
default:
break;
}
+
return ret;
}