From 66c5a7169a1377282edff0b8e0f7a33393ce8797 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Wed, 24 Jun 2020 11:02:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dmetadata=E4=B8=AD=E6=B2=A1dur?= =?UTF-8?q?ation=E5=AF=BC=E8=87=B4=E6=92=AD=E6=94=BE=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E7=9A=84bug:#362?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rtmp/RtmpSession.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Rtmp/RtmpSession.cpp b/src/Rtmp/RtmpSession.cpp index 95076682..d52b0943 100644 --- a/src/Rtmp/RtmpSession.cpp +++ b/src/Rtmp/RtmpSession.cpp @@ -257,8 +257,8 @@ void RtmpSession::sendPlayResponse(const string &err,const RtmpMediaSource::Ptr invoke.clear(); invoke << "onMetaData" << metadata; sendResponse(MSG_DATA, invoke.data()); - auto duration = metadata["duration"].as_number(); - if(duration > 0){ + auto duration = metadata["duration"]; + if(duration && duration.as_number() > 0){ //这是点播,使用绝对时间戳 _stamp[0].setPlayBack(); _stamp[1].setPlayBack();