完善ntp时间戳计算逻辑

This commit is contained in:
ziyue
2021-09-02 21:17:59 +08:00
parent 72c2df057a
commit 415bc95dda
8 changed files with 36 additions and 32 deletions

View File

@@ -101,10 +101,10 @@ RtpPacket::Ptr RtpTrack::inputRtp(TrackType type, int sample_rate, uint8_t *ptr,
return rtp;
}
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);
void RtpTrack::setNtpStamp(uint32_t rtp_stamp, uint64_t ntp_stamp_ms) {
_disable_ntp = rtp_stamp == 0 && ntp_stamp_ms == 0;
if (!_disable_ntp) {
_ntp_stamp.setNtpStamp(rtp_stamp, ntp_stamp_ms);
}
}