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() +