Commit b3ad0891 by ziyue

修复除0的bug

parent 10afab77
......@@ -219,6 +219,7 @@ bool DtsGenerator::getDts_l(uint32_t pts, uint32_t &dts){
}
void NtpStamp::setNtpStamp(uint32_t rtp_stamp, uint32_t sample_rate, uint64_t ntp_stamp_ms) {
assert(sample_rate);
update(uint64_t(rtp_stamp) * 1000 / sample_rate, ntp_stamp_ms);
}
......
......@@ -103,7 +103,9 @@ RtpPacket::Ptr RtpTrack::inputRtp(TrackType type, int sample_rate, uint8_t *ptr,
void RtpTrack::setNtpStamp(uint32_t rtp_stamp, uint32_t sample_rate, uint64_t ntp_stamp_ms) {
_disable_ntp = rtp_stamp == 0 && sample_rate == 0 && ntp_stamp_ms == 0;
if (sample_rate) {
_ntp_stamp.setNtpStamp(rtp_stamp, sample_rate, ntp_stamp_ms);
}
}
////////////////////////////////////////////////////////////////////////////////////
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论