From 507eba76c709ab88867e4c11dc90837ef2452489 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Tue, 9 Apr 2019 11:25:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9=E6=97=A0config=E5=8C=85?= =?UTF-8?q?=E7=9A=84rtmp=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rtmp/RtmpMediaSource.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Rtmp/RtmpMediaSource.h b/src/Rtmp/RtmpMediaSource.h index f842211f..74ec8f70 100644 --- a/src/Rtmp/RtmpMediaSource.h +++ b/src/Rtmp/RtmpMediaSource.h @@ -100,6 +100,13 @@ public: _bRegisted = true; } } else{ + if(!_bRegisted){ + //强制在3秒后注册,不管是否有metedata或config包 + if(_ticker.createdTime() > 3 * 1000){ + MediaSource::regist(); + _bRegisted = true; + } + } _mapStamp[pkt->typeId] = pkt->timeStamp; _pRing->write(pkt,pkt->isVideoKeyFrame()); } @@ -130,6 +137,7 @@ protected: int _iCfgFrameSize = -1; bool _bAsyncRegist = false; bool _bRegisted = false; + Ticker _ticker; }; } /* namespace mediakit */