修改rtsp点播ntp时间戳

This commit is contained in:
xiongziliang 2021-09-29 00:25:34 +08:00
parent b1666eb651
commit 8d2d1e135c

View File

@ -28,8 +28,8 @@ void RtspMuxer::onRtp(RtpPacket::Ptr in, bool is_key) {
//rtp拦截入口此处统一赋值ntp //rtp拦截入口此处统一赋值ntp
in->ntp_stamp = _ntp_stamp[in->type]; in->ntp_stamp = _ntp_stamp[in->type];
} else { } else {
//点播情况下设置ntp时间戳为rtp时间戳 //点播情况下设置ntp时间戳为rtp时间戳加基准ntp时间戳
in->ntp_stamp = in->getStamp() * uint64_t(1000) / in->sample_rate; in->ntp_stamp = _ntp_stamp_start + (in->getStamp() * uint64_t(1000) / in->sample_rate);
} }
_rtpRing->write(std::move(in), is_key); _rtpRing->write(std::move(in), is_key);
} }