From: Doug Nazar Date: Mon, 17 May 2021 13:13:28 +0000 (-0400) Subject: sctp: Fix race of pad removal during reset/stop X-Git-Tag: 1.19.3~507^2~387 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5663db236f8b7c17cc7065a982ea81a86c9e2fe1;p=platform%2Fupstream%2Fgstreamer.git 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: --- diff --git a/ext/sctp/gstsctpdec.c b/ext/sctp/gstsctpdec.c index e3f1a08..097b629 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);