summary refs log tree commit diff
path: root/src/WebRTCSession.cpp
diff options
context:
space:
mode:
authorJussi Kuokkanen <jussi.kuokkanen@protonmail.com>2020-09-17 16:51:50 +0300
committerJussi Kuokkanen <jussi.kuokkanen@protonmail.com>2020-09-17 16:51:50 +0300
commit7d72356318084d75dceee3e3983db6c40d129e31 (patch)
tree04902a3d6d5852ba43007d21828f062af0a926fe /src/WebRTCSession.cpp
parentuse Rectangle for typing users so it doesn't overlap with the timeline (diff)
parentMerge pull request #284 from Nheko-Reborn/hidden-events (diff)
downloadnheko-7d72356318084d75dceee3e3983db6c40d129e31.tar.xz
Merge branch 'master' of https://github.com/Nheko-Reborn/nheko
Diffstat (limited to 'src/WebRTCSession.cpp')
-rw-r--r--src/WebRTCSession.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/WebRTCSession.cpp b/src/WebRTCSession.cpp

index 1c1d008d..a3900b48 100644 --- a/src/WebRTCSession.cpp +++ b/src/WebRTCSession.cpp
@@ -426,8 +426,12 @@ WebRTCSession::acceptICECandidates( for (const auto &c : candidates) { nhlog::ui()->debug( "WebRTC: remote candidate: (m-line:{}):{}", c.sdpMLineIndex, c.candidate); - g_signal_emit_by_name( - webrtc_, "add-ice-candidate", c.sdpMLineIndex, c.candidate.c_str()); + if (!c.candidate.empty()) { + g_signal_emit_by_name(webrtc_, + "add-ice-candidate", + c.sdpMLineIndex, + c.candidate.c_str()); + } } } } @@ -491,7 +495,7 @@ WebRTCSession::startPipeline(int opusPayloadType) } GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(pipe_)); - gst_bus_add_watch(bus, newBusMessage, this); + busWatchId_ = gst_bus_add_watch(bus, newBusMessage, this); gst_object_unref(bus); emit stateChanged(State::INITIATED); return true; @@ -597,6 +601,8 @@ WebRTCSession::end() gst_element_set_state(pipe_, GST_STATE_NULL); gst_object_unref(pipe_); pipe_ = nullptr; + g_source_remove(busWatchId_); + busWatchId_ = 0; } webrtc_ = nullptr; if (state_ != State::DISCONNECTED)