mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 11:11:08 +00:00
webrtcbin: Clean up bin elements when datachannel is removed
When a datachannel within a session is removed after proper close, reference to the error_ignore_bin elements of the datachannel appsrc/appsink were left in webrtcbin. This caused the bin-objects to be left and not freed until the whole webrtc session was terminated. Among other things that includes a thread from the appsrc. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7675>
This commit is contained in:
parent
ada194b725
commit
68bbfdc9a2
1 changed files with 12 additions and 2 deletions
|
@ -2629,8 +2629,18 @@ _on_data_channel_ready_state (WebRTCDataChannel * channel,
|
|||
|
||||
if (found == FALSE) {
|
||||
GST_FIXME_OBJECT (webrtc, "Received close for unknown data channel");
|
||||
} else if (found_pending == FALSE) {
|
||||
webrtc->priv->data_channels_closed++;
|
||||
} else {
|
||||
gst_element_set_locked_state (channel->src_bin, TRUE);
|
||||
gst_element_set_state (channel->src_bin, GST_STATE_NULL);
|
||||
gst_bin_remove (GST_BIN (webrtc), channel->src_bin);
|
||||
|
||||
gst_element_set_locked_state (channel->sink_bin, TRUE);
|
||||
gst_element_set_state (channel->sink_bin, GST_STATE_NULL);
|
||||
gst_bin_remove (GST_BIN (webrtc), channel->sink_bin);
|
||||
|
||||
if (found_pending == FALSE) {
|
||||
webrtc->priv->data_channels_closed++;
|
||||
}
|
||||
}
|
||||
DC_UNLOCK (webrtc);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue