mirror of
https://github.com/ossrs/srs.git
synced 2025-02-15 04:42:04 +00:00
RTC: Don't parse RTP header if no twcc
This commit is contained in:
parent
05441d6354
commit
7bb04998af
1 changed files with 2 additions and 2 deletions
|
@ -1123,14 +1123,13 @@ srs_error_t SrsRtcPublishStream::on_rtp(char* data, int nb_data)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Decode the header first.
|
// Decode the header first.
|
||||||
SrsRtpHeader h;
|
|
||||||
if (pt_to_drop_ || twcc_id_) {
|
if (pt_to_drop_ || twcc_id_) {
|
||||||
|
SrsRtpHeader h;
|
||||||
SrsBuffer b(data, nb_data);
|
SrsBuffer b(data, nb_data);
|
||||||
h.ignore_padding(true); h.set_extensions(&extension_types_);
|
h.ignore_padding(true); h.set_extensions(&extension_types_);
|
||||||
if ((err = h.decode(&b)) != srs_success) {
|
if ((err = h.decode(&b)) != srs_success) {
|
||||||
return srs_error_wrap(err, "twcc decode header");
|
return srs_error_wrap(err, "twcc decode header");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// We must parse the TWCC from RTP header before SRTP unprotect, because:
|
// We must parse the TWCC from RTP header before SRTP unprotect, because:
|
||||||
// 1. Client may send some padding packets with invalid SequenceNumber, which causes the SRTP fail.
|
// 1. Client may send some padding packets with invalid SequenceNumber, which causes the SRTP fail.
|
||||||
|
@ -1151,6 +1150,7 @@ srs_error_t SrsRtcPublishStream::on_rtp(char* data, int nb_data)
|
||||||
if (pt_to_drop_ && pt_to_drop_ == h.get_payload_type()) {
|
if (pt_to_drop_ && pt_to_drop_ == h.get_payload_type()) {
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Decrypt the cipher to plaintext RTP data.
|
// Decrypt the cipher to plaintext RTP data.
|
||||||
int nb_unprotected_buf = nb_data;
|
int nb_unprotected_buf = nb_data;
|
||||||
|
|
Loading…
Reference in a new issue