From dd81497e5cbf2a1a89533610d5d52c8200216dea Mon Sep 17 00:00:00 2001 From: ziyue <1213642868@qq.com> Date: Wed, 13 Oct 2021 15:52:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Drtp=20pts=20=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=88=B3=E5=9B=9E=E9=80=80=E5=AF=BC=E8=87=B4ntp?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=88=B3=E8=AE=A1=E7=AE=97=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E7=9A=84bug:#1152?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Common/Stamp.cpp | 4 +--- src/Rtsp/RtpReceiver.cpp | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Common/Stamp.cpp b/src/Common/Stamp.cpp index a2c9dacf..2129bd63 100644 --- a/src/Common/Stamp.cpp +++ b/src/Common/Stamp.cpp @@ -231,9 +231,7 @@ uint64_t NtpStamp::getNtpStamp(uint32_t rtp_stamp, uint32_t sample_rate) { if (rtp_stamp == _last_rtp_stamp) { return _last_ntp_stamp_ms; } - auto ret = getNtpStamp_l(rtp_stamp, sample_rate); - _last_rtp_stamp = rtp_stamp; - return ret; + return getNtpStamp_l(rtp_stamp, sample_rate); } uint64_t NtpStamp::getNtpStamp_l(uint32_t rtp_stamp, uint32_t sample_rate) { diff --git a/src/Rtsp/RtpReceiver.cpp b/src/Rtsp/RtpReceiver.cpp index 37364bab..e9af7264 100644 --- a/src/Rtsp/RtpReceiver.cpp +++ b/src/Rtsp/RtpReceiver.cpp @@ -94,7 +94,7 @@ RtpPacket::Ptr RtpTrack::inputRtp(TrackType type, int sample_rate, uint8_t *ptr, rtp->ntp_stamp = rtp->getStamp() * uint64_t(1000) / sample_rate; } else { //设置ntp时间戳 - rtp->ntp_stamp = _ntp_stamp.getNtpStamp(ntohl(rtp->getHeader()->stamp), sample_rate); + rtp->ntp_stamp = _ntp_stamp.getNtpStamp(rtp->getStamp(), sample_rate); } onBeforeRtpSorted(rtp); sortPacket(rtp->getSeq(), rtp);