From a7953fdbca2a46ff863dd93c600cb2ca3a29eb76 Mon Sep 17 00:00:00 2001 From: "3503207480@qq.com" <3503207480@qq.com> Date: Fri, 30 Aug 2019 11:18:25 +0800 Subject: [PATCH] =?UTF-8?q?=E9=99=A4=E4=BB=A50=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 有的rtsp设备无此参数,不能除以0 --- src/Rtsp/RtspPlayer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Rtsp/RtspPlayer.cpp b/src/Rtsp/RtspPlayer.cpp index a16bb61e..126135fe 100644 --- a/src/Rtsp/RtspPlayer.cpp +++ b/src/Rtsp/RtspPlayer.cpp @@ -450,7 +450,7 @@ void RtspPlayer::handleResPAUSE(const Parser& parser, bool bPause) { auto strRtpTime = FindField(strTrack.data(), "rtptime=", ";"); auto idx = getTrackIndexByControlSuffix(strControlSuffix); if(idx != -1){ - _aiFistStamp[idx] = atoll(strRtpTime.data()) * 1000 / _aTrackInfo[idx]->_samplerate; + _aiFistStamp[idx] = _aTrackInfo[idx]->_samplerate>0?atoll(strRtpTime.data()) * 1000 / _aTrackInfo[idx]->_samplerate :1; _aiNowStamp[idx] = _aiFistStamp[idx]; DebugL << "rtptime(ms):" << strControlSuffix <<" " << strRtpTime; }