From a972fa85ec5ce404aa64cc7845d092b582b7e228 Mon Sep 17 00:00:00 2001 From: PioLing <964472638@qq.com> Date: Wed, 6 Aug 2025 12:02:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9F=90=E4=BA=9B=E6=B5=81?= =?UTF-8?q?=E5=B8=A6aud=E5=B8=A7=E4=B8=8D=E5=85=BC=E5=AE=B9=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20(#4379)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ext-codec/H264.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ext-codec/H264.cpp b/ext-codec/H264.cpp index 4fc5423f..564308aa 100644 --- a/ext-codec/H264.cpp +++ b/ext-codec/H264.cpp @@ -153,10 +153,6 @@ bool H264Track::ready() const { bool H264Track::inputFrame(const Frame::Ptr &frame) { using H264FrameInternal = FrameInternal; int type = H264_TYPE(frame->data()[frame->prefixSize()]); - if (type == H264Frame::NAL_AUD) { - // AUD帧丢弃 - return false; - } if ((type == H264Frame::NAL_B_P || type == H264Frame::NAL_IDR) && ready()) { return inputFrame_l(frame); } @@ -266,6 +262,10 @@ Track::Ptr H264Track::clone() const { bool H264Track::inputFrame_l(const Frame::Ptr &frame) { int type = H264_TYPE(frame->data()[frame->prefixSize()]); + if (type == H264Frame::NAL_AUD) { + // AUD帧丢弃 + return false; + } bool ret = true; switch (type) { case H264Frame::NAL_SPS: {