webrtcrenego: Fix incorrect release of non-request pad

GStreamer-CRITICAL **: 16:39:23.230: gst_element_release_request_pad:
assertion 'GST_PAD_PAD_TEMPLATE (pad) == NULL ||
GST_PAD_TEMPLATE_PRESENCE (GST_PAD_PAD_TEMPLATE (pad)) ==
GST_PAD_REQUEST' failed

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5045>
This commit is contained in:
Nirbheek Chauhan 2023-07-17 16:40:05 +05:30 committed by GStreamer Marge Bot
parent fb406b7a56
commit 76b5178260

View file

@ -16,7 +16,7 @@ _element_message (GstElement * parent, GstMessage * msg)
{
switch (GST_MESSAGE_TYPE (msg)) {
case GST_MESSAGE_EOS:{
GstElement *receive, *webrtc;
GstElement *receive;
GstPad *pad, *peer;
g_print ("Got element EOS message from %s parent %s\n",
@ -27,11 +27,9 @@ _element_message (GstElement * parent, GstMessage * msg)
pad = gst_element_get_static_pad (receive, "sink");
peer = gst_pad_get_peer (pad);
webrtc = GST_ELEMENT (gst_pad_get_parent (peer));
gst_bin_remove (GST_BIN (pipe1), receive);
gst_pad_unlink (peer, pad);
gst_element_release_request_pad (webrtc, peer);
gst_object_unref (pad);
gst_object_unref (peer);