修复NTP时间戳计算精度不足导致误差累积问题 (#2576 #2570 )

ntp时间戳计算精度由毫秒调整为微秒,解决误差累积问题。
This commit is contained in:
Luosh
2023-06-21 17:20:39 +08:00
committed by GitHub
parent 9f753b5e5f
commit 24d210f61d
2 changed files with 31 additions and 31 deletions

View File

@@ -125,12 +125,12 @@ public:
uint64_t getNtpStamp(uint32_t rtp_stamp, uint32_t sample_rate);
private:
void update(uint32_t rtp_stamp, uint64_t ntp_stamp_ms);
uint64_t getNtpStamp_l(uint32_t rtp_stamp, uint32_t sample_rate);
void update(uint32_t rtp_stamp, uint64_t ntp_stamp_us);
uint64_t getNtpStampUS(uint32_t rtp_stamp, uint32_t sample_rate);
private:
uint32_t _last_rtp_stamp = 0;
uint64_t _last_ntp_stamp_ms = 0;
uint64_t _last_ntp_stamp_us = 0;
};
}//namespace mediakit