From c857968f401288d07472bd872f850b50bafde04e Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Mon, 27 May 2019 10:58:08 +0800 Subject: [PATCH] =?UTF-8?q?flv=E5=BD=95=E5=88=B6=E5=BB=B6=E6=97=B6?= =?UTF-8?q?=E4=B8=A4=E7=A7=92=E5=90=AF=E5=8A=A8=EF=BC=8C=E9=98=B2=E6=AD=A2?= =?UTF-8?q?=E6=94=B6=E9=9B=86config=E5=B8=A7=E4=B8=8D=E9=BD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 3rdpart/ZLToolKit | 2 +- src/RtmpMuxer/FlvMuxer.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/3rdpart/ZLToolKit b/3rdpart/ZLToolKit index 02d8b5df..f9297f31 160000 --- a/3rdpart/ZLToolKit +++ b/3rdpart/ZLToolKit @@ -1 +1 @@ -Subproject commit 02d8b5df6a93cc84b605a548220fd552061e66c5 +Subproject commit f9297f31e570e4ca6f3ab1bee32eadebfbee1c1f diff --git a/src/RtmpMuxer/FlvMuxer.cpp b/src/RtmpMuxer/FlvMuxer.cpp index ddb15317..6354b40a 100644 --- a/src/RtmpMuxer/FlvMuxer.cpp +++ b/src/RtmpMuxer/FlvMuxer.cpp @@ -44,11 +44,13 @@ void FlvMuxer::start(const EventPoller::Ptr &poller,const RtmpMediaSource::Ptr & } if(!poller->isCurrentThread()){ weak_ptr weakSelf = getSharedPtr(); - poller->async([weakSelf,poller,media](){ + //延时两秒启动录制,目的是为了等待config帧收集完毕 + poller->doDelayTask(2000,[weakSelf,poller,media](){ auto strongSelf = weakSelf.lock(); if(strongSelf){ strongSelf->start(poller,media); } + return 0; }); return; }