From ad1ae2ac66d15525c71b2795473978914dc2604b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E6=A5=9A?= <771730766@qq.com> Date: Sat, 4 Sep 2021 09:28:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dntp=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=88=B3=E8=AE=A1=E7=AE=97=E7=B2=BE=E5=BA=A6=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9A=84bug:#1086?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Common/Stamp.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Common/Stamp.cpp b/src/Common/Stamp.cpp index 102d1e16..a2c9dacf 100644 --- a/src/Common/Stamp.cpp +++ b/src/Common/Stamp.cpp @@ -244,7 +244,7 @@ uint64_t NtpStamp::getNtpStamp_l(uint32_t rtp_stamp, uint32_t sample_rate) { //rtp时间戳正增长 if (rtp_stamp >= _last_rtp_stamp) { - auto diff = (rtp_stamp - _last_rtp_stamp) / (sample_rate / 1000.0f); + auto diff = static_cast((rtp_stamp - _last_rtp_stamp) / (sample_rate / 1000.0f)); if (diff < MAX_DELTA_STAMP) { //时间戳正常增长 update(rtp_stamp, _last_ntp_stamp_ms + diff); @@ -264,7 +264,7 @@ uint64_t NtpStamp::getNtpStamp_l(uint32_t rtp_stamp, uint32_t sample_rate) { } //rtp时间戳负增长 - auto diff = (_last_rtp_stamp - rtp_stamp) / (sample_rate / 1000.0f); + auto diff = static_cast((_last_rtp_stamp - rtp_stamp) / (sample_rate / 1000.0f)); if (diff < MAX_DELTA_STAMP) { //正常范围的时间戳回退,说明收到rtp乱序了 return _last_ntp_stamp_ms - diff; @@ -283,4 +283,4 @@ uint64_t NtpStamp::getNtpStamp_l(uint32_t rtp_stamp, uint32_t sample_rate) { return _last_ntp_stamp_ms; } -}//namespace mediakit \ No newline at end of file +}//namespace mediakit