From a52e9d6ba832ff74d3c09d30a7937b79b7d69b48 Mon Sep 17 00:00:00 2001 From: xiongguangjie Date: Sat, 4 Feb 2023 18:17:06 +0800 Subject: [PATCH] fix h264 no idr nal sps pps sei i slices --- src/Extension/H264.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Extension/H264.cpp b/src/Extension/H264.cpp index c9852547..2395159b 100644 --- a/src/Extension/H264.cpp +++ b/src/Extension/H264.cpp @@ -151,6 +151,7 @@ bool H264Track::ready() { bool H264Track::inputFrame(const Frame::Ptr &frame) { using H264FrameInternal = FrameInternal; int type = H264_TYPE(frame->data()[frame->prefixSize()]); + if ((type == H264Frame::NAL_B_P || type == H264Frame::NAL_IDR) && ready()) { return inputFrame_l(frame); } @@ -204,7 +205,9 @@ bool H264Track::inputFrame_l(const Frame::Ptr &frame) { if (frame->keyFrame() && !_latest_is_config_frame) { insertConfigFrame(frame); } - _latest_is_config_frame = false; + if(!frame->dropAble()){ + _latest_is_config_frame = false; + } ret = VideoTrack::inputFrame(frame); break; }