diff options
author | Doug Nazar <nazard@nazar.ca> | 2021-05-17 09:13:28 -0400 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2021-05-19 05:49:48 +0000 |
commit | 5663db236f8b7c17cc7065a982ea81a86c9e2fe1 (patch) | |
tree | 7b103e60e2f8a3107de619ca4387c3b3f1a6c4a7 /ext | |
parent | 4fcfd5b7f9dcde8d3888b58ab04f61d402896b7e (diff) | |
download | gstreamer-plugins-bad-5663db236f8b7c17cc7065a982ea81a86c9e2fe1.tar.gz |
sctp: Fix race of pad removal during reset/stop
Both reset & stop remove existing pads. Can result in warning from
gst_element_remove_pad().
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2256>
Diffstat (limited to 'ext')
-rw-r--r-- | ext/sctp/gstsctpdec.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/sctp/gstsctpdec.c b/ext/sctp/gstsctpdec.c index e3f1a08c9..097b629b9 100644 --- a/ext/sctp/gstsctpdec.c +++ b/ext/sctp/gstsctpdec.c @@ -606,8 +606,11 @@ static void remove_pad (GstSctpDec * self, GstPad * pad) { stop_srcpad_task (pad); + GST_PAD_STREAM_LOCK (pad); gst_pad_set_active (pad, FALSE); - gst_element_remove_pad (GST_ELEMENT (self), pad); + if (gst_object_has_as_parent (GST_OBJECT (pad), GST_OBJECT (self))) + gst_element_remove_pad (GST_ELEMENT (self), pad); + GST_PAD_STREAM_UNLOCK (pad); GST_OBJECT_LOCK (self); gst_flow_combiner_remove_pad (self->flow_combiner, pad); GST_OBJECT_UNLOCK (self); |