From 8a27e11c4c267a65f60ecf1de9155570d4269ebd Mon Sep 17 00:00:00 2001 From: xia-chu <771730766@qq.com> Date: Sun, 1 Dec 2024 10:26:50 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=B2=E6=AD=A2ps/ts=E4=B8=8D=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E7=BC=96=E7=A0=81=E7=B1=BB=E5=9E=8B=E6=97=B6=E8=AD=A6?= =?UTF-8?q?=E5=91=8A=E6=97=A5=E5=BF=97=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rtp/Decoder.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Rtp/Decoder.cpp b/src/Rtp/Decoder.cpp index 54d213dd..61cbdd7c 100644 --- a/src/Rtp/Decoder.cpp +++ b/src/Rtp/Decoder.cpp @@ -91,9 +91,11 @@ void DecoderImp::onStream(int stream, int codecid, const void *extra, size_t byt // G711传统只支持 8000/1/16的规格,FFmpeg貌似做了扩展,但是这里不管它了 [AUTO-TRANSLATED:851813f7] // G711 traditionally only supports the 8000/1/16 specification. FFmpeg seems to have extended it, but we'll ignore that here. auto codec = getCodecByMpegId(codecid); - auto track= Factory::getTrackByCodecId(codec); - if (track) { - onTrack(stream, std::move(track)); + if (codec != CodecInvalid) { + auto track = Factory::getTrackByCodecId(codec); + if (track) { + onTrack(stream, std::move(track)); + } } // 防止未获取视频track提前complete导致忽略后续视频的问题,用于兼容一些不太规范的ps流 [AUTO-TRANSLATED:d6b349b5] // Prevent the problem of ignoring subsequent video due to premature completion of the video track before it is obtained. This is used to be compatible with some non-standard PS streams.