mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 10:40:05 +08:00
忽略非法的rtcp ntp时间戳
有些设备在发送sender report rtcp时,其rtp和ntp时间戳一直为0,将导致zlmediakit计算出的ntp时间戳异常
This commit is contained in:
parent
ccddb84a19
commit
2410419911
@ -231,14 +231,15 @@ bool DtsGenerator::getDts_l(uint64_t pts, uint64_t &dts) {
|
||||
}
|
||||
|
||||
void NtpStamp::setNtpStamp(uint32_t rtp_stamp, uint64_t ntp_stamp_ms) {
|
||||
if (!ntp_stamp_ms || !rtp_stamp) {
|
||||
// 实测发现有些rtsp服务器发送的rtp时间戳和ntp时间戳一直为0
|
||||
WarnL << "Invalid sender report rtcp, ntp_stamp_ms = " << ntp_stamp_ms << ", rtp_stamp = " << rtp_stamp;
|
||||
return;
|
||||
}
|
||||
update(rtp_stamp, ntp_stamp_ms);
|
||||
}
|
||||
|
||||
void NtpStamp::update(uint32_t rtp_stamp, uint64_t ntp_stamp_ms) {
|
||||
if (ntp_stamp_ms == 0) {
|
||||
// 实测发现有些rtsp服务器发送的rtp时间戳和ntp时间戳一直为0
|
||||
return;
|
||||
}
|
||||
_last_rtp_stamp = rtp_stamp;
|
||||
_last_ntp_stamp_ms = ntp_stamp_ms;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user