Skip to content

Fix file descriptor leak on webrtcbin closing #221

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions codec/gstEncoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -919,8 +919,12 @@ void gstEncoder::onWebsocketMessage( WebRTCPeer* peer, const char* message, size
LogVerbose(LOG_WEBRTC "WebRTC peer disconnected (%s, peer_id=%u)\n", peer->ip_address.c_str(), peer->ID);

// remove webrtcbin from pipeline
GstBus * bus = gst_pipeline_get_bus(GST_PIPELINE(encoder->mPipeline));
gst_bus_set_flushing(bus, true);
gst_bin_remove(GST_BIN(encoder->mPipeline), peer_context->webrtcbin);
gst_element_set_state(peer_context->webrtcbin, GST_STATE_NULL);
gst_bus_set_flushing(bus, false);
gst_object_unref(bus);
gst_object_unref(peer_context->webrtcbin);

// disconnect queue pads
Expand Down