summaryrefslogtreecommitdiff
path: root/ext/sctp/gstsctpenc.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/sctp/gstsctpenc.c')
-rw-r--r--ext/sctp/gstsctpenc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/sctp/gstsctpenc.c b/ext/sctp/gstsctpenc.c
index 99a0e83d2..e420fe0c8 100644
--- a/ext/sctp/gstsctpenc.c
+++ b/ext/sctp/gstsctpenc.c
@@ -483,7 +483,10 @@ gst_sctp_enc_release_pad (GstElement * element, GstPad * pad)
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