From 6889afbc76bec74e39cdcf4cdff3379eb4a1a35b Mon Sep 17 00:00:00 2001 From: yujitai Date: Wed, 14 Aug 2024 20:11:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BC=B1=E7=BD=91=E4=B8=A2?= =?UTF-8?q?=E5=8C=85=E5=9C=BA=E6=99=AF=E4=B8=8Brtp=E8=A7=A3=E7=A0=81?= =?UTF-8?q?=E5=99=A8=E5=8F=AF=E8=83=BD=E4=B8=8D=E4=BC=9A=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=B8=A7=E7=9A=84=E9=97=AE=E9=A2=98=20(#3818?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在弱网丢包场景下,rtp解码器很可能进入gop dropped状态,需要等到idr到来才能继续输出帧, 这会导致idr前面的sps/pps无法被输出, 进而可能导致播放器渲染失败 --- ext-codec/H264Rtp.cpp | 2 +- ext-codec/H265Rtp.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ext-codec/H264Rtp.cpp b/ext-codec/H264Rtp.cpp index 1972a040..f7ae195d 100644 --- a/ext-codec/H264Rtp.cpp +++ b/ext-codec/H264Rtp.cpp @@ -184,7 +184,7 @@ void H264RtpDecoder::outputFrame(const RtpPacket::Ptr &rtp, const H264Frame::Ptr _gop_dropped = false; InfoL << "new gop received, rtp:\r\n" << rtp->dumpString(); } - if (!_gop_dropped) { + if (!_gop_dropped || frame->configFrame()) { RtpCodec::inputFrame(frame); } _frame = obtainFrame(); diff --git a/ext-codec/H265Rtp.cpp b/ext-codec/H265Rtp.cpp index 6f05e67f..69690423 100644 --- a/ext-codec/H265Rtp.cpp +++ b/ext-codec/H265Rtp.cpp @@ -240,7 +240,7 @@ void H265RtpDecoder::outputFrame(const RtpPacket::Ptr &rtp, const H265Frame::Ptr _gop_dropped = false; InfoL << "new gop received, rtp:\r\n" << rtp->dumpString(); } - if (!_gop_dropped) { + if (!_gop_dropped || frame->configFrame()) { RtpCodec::inputFrame(frame); } _frame = obtainFrame();