From 73df1bb949e35e7efc846d956c5c0912df1dc1dc Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Wed, 18 Dec 2019 15:02:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=89=E5=85=A8=E5=86=97?= =?UTF-8?q?=E4=BD=99=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Record/MP4Muxer.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Record/MP4Muxer.cpp b/src/Record/MP4Muxer.cpp index 53bd61ae..b1805db4 100644 --- a/src/Record/MP4Muxer.cpp +++ b/src/Record/MP4Muxer.cpp @@ -129,6 +129,10 @@ void MP4Muxer::addTrack(const Track::Ptr &track) { WarnL << "不是AAC Track"; return; } + if(!aac_track->ready()){ + WarnL << "AAC Track未就绪"; + return; + } auto track_id = mov_writer_add_audio(_mov_writter.get(), MOV_OBJECT_AAC, aac_track->getAudioChannel(), @@ -148,6 +152,10 @@ void MP4Muxer::addTrack(const Track::Ptr &track) { WarnL << "不是H264 Track"; return; } + if(!h264_track->ready()){ + WarnL << "H264 Track未就绪"; + return; + } struct mpeg4_avc_t avc; string sps_pps = string("\x00\x00\x00\x01", 4) + h264_track->getSps() + @@ -181,6 +189,10 @@ void MP4Muxer::addTrack(const Track::Ptr &track) { WarnL << "不是H265 Track"; return; } + if(!h265_track->ready()){ + WarnL << "H265 Track未就绪"; + return; + } struct mpeg4_hevc_t hevc; string vps_sps_pps = string("\x00\x00\x00\x01", 4) + h265_track->getVps() +