From 91a766243b630a35d2c3569c6179e9f0f5782dca Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Fri, 26 Oct 2018 17:30:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/RtmpMuxer/RtmpMuxer.cpp | 6 +----- src/RtspMuxer/RtspMuxer.cpp | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/RtmpMuxer/RtmpMuxer.cpp b/src/RtmpMuxer/RtmpMuxer.cpp index 32408fe1..dfe02baa 100644 --- a/src/RtmpMuxer/RtmpMuxer.cpp +++ b/src/RtmpMuxer/RtmpMuxer.cpp @@ -88,12 +88,8 @@ void RtmpMuxer::inputFrame(const Frame::Ptr &frame) { if (it == _track_map.end()) { return; } - //Track是否准备好 - auto ready = it->second->ready(); - //inputFrame可能使Track变成就绪状态 it->second->inputFrame(frame); - - if(!ready && it->second->ready()){ + if(!_trackReadyCallback.empty() && it->second->ready()){ //Track由未就绪状态装换成就绪状态,我们就生成metedata以及Rtmp编码器 auto it_callback = _trackReadyCallback.find(codec_id); if(it_callback != _trackReadyCallback.end()){ diff --git a/src/RtspMuxer/RtspMuxer.cpp b/src/RtspMuxer/RtspMuxer.cpp index 1d58de5f..08f338e0 100644 --- a/src/RtspMuxer/RtspMuxer.cpp +++ b/src/RtspMuxer/RtspMuxer.cpp @@ -77,12 +77,8 @@ void RtspMuxer::inputFrame(const Frame::Ptr &frame) { if (it == _track_map.end()) { return; } - //Track是否准备好 - auto ready = it->second->ready(); - //inputFrame可能使Track变成就绪状态 it->second->inputFrame(frame); - - if(!ready && it->second->ready()){ + if(!_trackReadyCallback.empty() && it->second->ready()){ //Track由未就绪状态装换成就绪状态,我们就生成sdp以及rtp编码器 auto it_callback = _trackReadyCallback.find(codec_id); if(it_callback != _trackReadyCallback.end()){