From 6b2fcf79435656be7797d396203adcc6c11ecc52 Mon Sep 17 00:00:00 2001 From: xiongguangjie Date: Sun, 29 Sep 2024 11:55:58 +0800 Subject: [PATCH] Fix the issue where the hls-fmp4 do not flush data in single audio cases (#3935 #3937) --- src/Record/MP4Muxer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Record/MP4Muxer.cpp b/src/Record/MP4Muxer.cpp index ffa3295f..8fd0567e 100644 --- a/src/Record/MP4Muxer.cpp +++ b/src/Record/MP4Muxer.cpp @@ -247,7 +247,8 @@ bool MP4MuxerMemory::inputFrame(const Frame::Ptr &frame) { _key_frame = false; } - if (frame->keyFrame()) { + // only audio all frame is key frame + if (frame->keyFrame() || !haveVideo()) { _key_frame = true; } if (frame->getTrackType() == TrackVideo || !haveVideo()) {