From fff4e2b3d4c45d6af50776fa2d255abbb851acc9 Mon Sep 17 00:00:00 2001 From: Ramkoemar Date: Tue, 27 Oct 2020 17:09:56 +0100 Subject: [PATCH] WebRTC output DTLS optional for RTCP packets --- src/output/output_webrtc.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/output/output_webrtc.cpp b/src/output/output_webrtc.cpp index 572f67f6..c8977562 100644 --- a/src/output/output_webrtc.cpp +++ b/src/output/output_webrtc.cpp @@ -1122,11 +1122,14 @@ namespace Mist{ }else{ //Decrypt feedback packet int len = udp.data.size(); - if (srtpReader.unprotectRtcp((uint8_t *)(char*)udp.data, &len) != 0){ - if (packetLog.is_open()){packetLog << "[" << Util::bootMS() << "]" << "RTCP decrypt failure" << std::endl;} - FAIL_MSG("Failed to unprotect RTCP."); - return; + if (doDTLS){ + if (srtpReader.unprotectRtcp((uint8_t *)(char*)udp.data, &len) != 0){ + if (packetLog.is_open()){packetLog << "[" << Util::bootMS() << "]" << "RTCP decrypt failure" << std::endl;} + FAIL_MSG("Failed to unprotect RTCP."); + return; + } } + lastRecv = Util::bootMS(); uint8_t fmt = udp.data[0] & 0x1F; if (pt == 77 || pt == 65){