修复metadata中没duration导致播放失败的bug:#362

This commit is contained in:
xiongziliang 2020-06-24 11:02:35 +08:00
parent c49812fe73
commit 66c5a7169a

View File

@ -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();