From 43cc01222fbc146777eca013ac4fdfd7c5d95ffc Mon Sep 17 00:00:00 2001 From: Sangchul Lee Date: Fri, 15 Oct 2021 12:07:47 +0900 Subject: [PATCH] webrtcbin: Remove transceiver from array when releasing pad Previously, even after releasing a pad, 'create-offer' could not get valid sdp message. It is fixed. Change-Id: I21120e5a4064f0c51cdf6dce88f51079592f5161 Signed-off-by: Sangchul Lee --- ext/webrtc/gstwebrtcbin.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ext/webrtc/gstwebrtcbin.c b/ext/webrtc/gstwebrtcbin.c index 3b7a3da79..7162e8784 100644 --- a/ext/webrtc/gstwebrtcbin.c +++ b/ext/webrtc/gstwebrtcbin.c @@ -640,6 +640,9 @@ _remove_pad (GstWebRTCBin * webrtc, GstWebRTCBinPad * pad) _remove_pending_pad (webrtc, pad); gst_element_remove_pad (GST_ELEMENT (webrtc), GST_PAD (pad)); +#ifdef __TIZEN__ + webrtc->priv->max_sink_pad_serial--; +#endif } typedef struct @@ -1863,6 +1866,16 @@ _create_webrtc_transceiver (GstWebRTCBin * webrtc, return trans; } +#ifdef __TIZEN__ +static void +_remove_webrtc_transceiver (GstWebRTCBin * webrtc, + WebRTCTransceiver * trans) +{ + g_ptr_array_remove (webrtc->priv->transceivers, trans); + gst_object_unref (trans); +} +#endif + static TransportStream * _create_transport_channel (GstWebRTCBin * webrtc, guint session_id) { @@ -6279,7 +6292,11 @@ gst_webrtc_bin_release_pad (GstElement * element, GstPad * pad) * a possibly dead transceiver */ PC_LOCK (webrtc); if (webrtc_pad->trans) +#ifdef __TIZEN__ + _remove_webrtc_transceiver (webrtc, webrtc_pad->trans); +#else gst_object_unref (webrtc_pad->trans); +#endif webrtc_pad->trans = NULL; PC_UNLOCK (webrtc); -- 2.34.1