Commit 147ba614 by ziyue

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

parent caf6ddf5
......@@ -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;
......
......@@ -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;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论