From 8b16e9e56bc2e244e330d86d29b6414515040354 Mon Sep 17 00:00:00 2001 From: Luke Strickland Date: Tue, 17 Nov 2020 21:30:40 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=99=20Adding=20at=20least=20logging,?= =?UTF-8?q?=20and=20some=20wrong=20code=20to=20HangUpMedia?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JanusFtl.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/JanusFtl.cpp b/JanusFtl.cpp index 157d5f9..8b79a31 100644 --- a/JanusFtl.cpp +++ b/JanusFtl.cpp @@ -220,6 +220,21 @@ void JanusFtl::DataReady(janus_plugin_session* handle) void JanusFtl::HangUpMedia(janus_plugin_session* handle) { // TODO + JANUS_LOG(LOG_INFO, "FTL: HangUpMedia\n"); + + std::shared_ptr session; + { + std::lock_guard lock(sessionsMutex); + if (sessions.count(handle) <= 0) + { + JANUS_LOG(LOG_ERR, "FTL: No session associated with this handle...\n"); + return; + } + session = sessions[handle]; + } + + session->SetIsStarted(false); + session->ResetRtpSwitchingContext(); } void JanusFtl::DestroySession(janus_plugin_session* handle, int* error) @@ -518,4 +533,4 @@ std::string JanusFtl::generateSdpOffer( } return offerStream.str(); } -#pragma endregion \ No newline at end of file +#pragma endregion