From a53fe451ffa871f70a4c6c189349bf1ad814650c Mon Sep 17 00:00:00 2001 From: winlin Date: Thu, 11 Mar 2021 16:48:29 +0800 Subject: [PATCH] RTC: Feed TWCC then drop the specified PT packet. 1. Sometimes we might drop RTP packets, by PT(payload type). 2. For example, the padding packets from client. 3. We should feed these packets to TWCC, then drop it. --- trunk/src/app/srs_app_rtc_conn.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/trunk/src/app/srs_app_rtc_conn.cpp b/trunk/src/app/srs_app_rtc_conn.cpp index c82241052..e6afab909 100644 --- a/trunk/src/app/srs_app_rtc_conn.cpp +++ b/trunk/src/app/srs_app_rtc_conn.cpp @@ -1116,14 +1116,6 @@ srs_error_t SrsRtcPublishStream::on_rtp(char* data, int nb_data) return err; } - // If payload type is configed to drop, ignore this packet. - if (pt_to_drop_) { - uint8_t pt = srs_rtp_fast_parse_pt(data, nb_data); - if (pt_to_drop_ == pt) { - return err; - } - } - // Decode the header first. if (twcc_id_) { // We must parse the TWCC from RTP header before SRTP unprotect, because: @@ -1140,6 +1132,14 @@ srs_error_t SrsRtcPublishStream::on_rtp(char* data, int nb_data) } } + // If payload type is configed to drop, ignore this packet. + if (pt_to_drop_) { + uint8_t pt = srs_rtp_fast_parse_pt(data, nb_data); + if (pt_to_drop_ == pt) { + return err; + } + } + // Decrypt the cipher to plaintext RTP data. char* plaintext = data; int nb_plaintext = nb_data;