From 09d7670fdf4ff6e092e24ef74ba55e6453ac2748 Mon Sep 17 00:00:00 2001 From: ziyue <1213642868@qq.com> Date: Wed, 14 Jul 2021 21:41:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B6=E5=88=B0sender=20report=E5=8C=85?= =?UTF-8?q?=E5=89=8D=EF=BC=8C=E9=80=9A=E8=BF=87=E7=B3=BB=E7=BB=9F=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=88=B3=E4=BA=A7=E7=94=9Fntp=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=88=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Common/Stamp.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Common/Stamp.cpp b/src/Common/Stamp.cpp index 8d177db2..476f3cd0 100644 --- a/src/Common/Stamp.cpp +++ b/src/Common/Stamp.cpp @@ -229,11 +229,11 @@ uint64_t NtpStamp::getNtpStamp(uint32_t rtp_stamp, uint32_t sample_rate) { } uint64_t rtp_stamp_ms = uint64_t(rtp_stamp) * 1000 / sample_rate; if (!_rtp_stamp_ms && !_ntp_stamp_ms) { - //尚未收到sender report rtcp包 - _last_ret = rtp_stamp_ms; - _last_rtp_stamp = rtp_stamp; - return rtp_stamp_ms; + //尚未收到sender report rtcp包,那么赋值为本地系统时间戳吧 + _rtp_stamp_ms = rtp_stamp_ms; + _ntp_stamp_ms = getCurrentMillisecond(true); } + uint64_t max_rtp_ms = uint64_t(UINT32_MAX) * 1000 / sample_rate; if (rtp_stamp_ms > _rtp_stamp_ms) { auto diff = rtp_stamp_ms - _rtp_stamp_ms;