rtsp/rtp: 过滤干扰的rtp pt, 提高兼容性: #1445

This commit is contained in:
ziyue 2022-02-22 16:53:05 +08:00
parent caf6ddf554
commit 147ba6147c
2 changed files with 8 additions and 0 deletions

View File

@ -55,6 +55,13 @@ RtpPacket::Ptr RtpTrack::inputRtp(TrackType type, int sample_rate, uint8_t *ptr,
//比对缓存ssrc
auto ssrc = ntohl(header->ssrc);
if (_pt == 0xFF) {
_pt = header->pt;
} else if (header->pt != _pt) {
TraceL << "rtp pt 不匹配:" << (int) header->pt << " !=" << (int) _pt;
return nullptr;
}
if (!_ssrc) {
//记录并锁定ssrc
_ssrc = ssrc;

View File

@ -182,6 +182,7 @@ protected:
private:
bool _disable_ntp = false;
uint8_t _pt = 0xFF;
uint32_t _ssrc = 0;
toolkit::Ticker _ssrc_alive;
NtpStamp _ntp_stamp;