From cb00dbab0f5c16ebcac0f1b8fdfecdbb7374ea0a Mon Sep 17 00:00:00 2001 From: ziyue <1213642868@qq.com> Date: Thu, 17 Feb 2022 14:32:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8track=E5=B0=B1=E7=BB=AA=E5=89=8D?= =?UTF-8?q?=EF=BC=8C=E5=BC=BA=E5=88=B6split=20frame=EF=BC=8C=E9=98=B2?= =?UTF-8?q?=E6=AD=A2sps=20pps=E6=9C=AA=E8=A2=AB=E8=8E=B7=E5=8F=96=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Extension/H264.cpp | 2 +- src/Extension/H265.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Extension/H264.cpp b/src/Extension/H264.cpp index df113924..fd2d3b91 100644 --- a/src/Extension/H264.cpp +++ b/src/Extension/H264.cpp @@ -148,7 +148,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) { + if ((type == H264Frame::NAL_B_P || type == H264Frame::NAL_IDR) && ready()) { return inputFrame_l(frame); } diff --git a/src/Extension/H265.cpp b/src/Extension/H265.cpp index 8586c2cc..8877371d 100644 --- a/src/Extension/H265.cpp +++ b/src/Extension/H265.cpp @@ -94,7 +94,7 @@ bool H265Track::ready() { bool H265Track::inputFrame(const Frame::Ptr &frame) { int type = H265_TYPE(frame->data()[frame->prefixSize()]); - if (!frame->configFrame() && type != H265Frame::NAL_SEI_PREFIX) { + if (!frame->configFrame() && type != H265Frame::NAL_SEI_PREFIX && ready()) { return inputFrame_l(frame); } bool ret = false;