修改rtp pt时,确保不影响其他播放器

This commit is contained in:
xiongziliang
2021-04-04 21:42:11 +08:00
parent 2abb5078f9
commit c70721a520
4 changed files with 10 additions and 13 deletions

View File

@@ -213,7 +213,7 @@ namespace RTC
}
}
bool SrtpSession::EncryptRtp(const uint8_t** data, size_t* len)
bool SrtpSession::EncryptRtp(const uint8_t** data, size_t* len, uint8_t pt)
{
MS_TRACE();
@@ -226,6 +226,7 @@ namespace RTC
}
std::memcpy(EncryptBuffer, *data, *len);
EncryptBuffer[1] |= (pt & 0x7F);
srtp_err_status_t err =
srtp_protect(this->session, static_cast<void*>(EncryptBuffer), reinterpret_cast<int*>(len));