During pipeline shutdown there are several competing paths to remove
pads. Avoids tests failing due to:
Unexpected critical/warning: Padname '':sink_1 does not belong to element sctpenc1 when removing
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2256>
if (self->sctp_association)
gst_sctp_association_reset_stream (self->sctp_association, stream_id);
- gst_element_remove_pad (element, pad);
+ GST_PAD_STREAM_LOCK (pad);
+ if (gst_object_has_as_parent (GST_OBJECT (pad), GST_OBJECT (element)))
+ gst_element_remove_pad (element, pad);
+ GST_PAD_STREAM_UNLOCK (pad);
}
static void