完善FLV复用器

This commit is contained in:
xiongziliang
2019-03-22 14:11:39 +08:00
parent 8ebf127ee6
commit 2b4d8a123d
3 changed files with 25 additions and 19 deletions

View File

@@ -42,6 +42,16 @@ void FlvMuxer::start(const EventPoller::Ptr &poller,const RtmpMediaSource::Ptr &
if(!media){
throw std::runtime_error("RtmpMediaSource 无效");
}
if(!poller->isCurrentThread()){
weak_ptr<FlvMuxer> weakSelf = getSharedPtr();
poller->async([weakSelf,poller,media](){
auto strongSelf = weakSelf.lock();
if(strongSelf){
strongSelf->start(poller,media);
}
});
return;
}
onWriteFlvHeader(media);