From 1bb3b433131905a2c6e22b808e783652e955c76c Mon Sep 17 00:00:00 2001 From: xia-chu <771730766@qq.com> Date: Fri, 26 Sep 2025 15:27:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9=E6=9F=90=E4=BA=9B=E4=B8=8D?= =?UTF-8?q?=E8=A7=84=E8=8C=83=E7=9A=84rtsp=E6=B5=81=20(#4463)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 兼容某些rtsp流sdp中的vps/sps/pps信息没有去除start code的问题 --- ext-codec/H264.cpp | 2 +- ext-codec/H265.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ext-codec/H264.cpp b/ext-codec/H264.cpp index 564308aa..28a6d9d0 100644 --- a/ext-codec/H264.cpp +++ b/ext-codec/H264.cpp @@ -391,7 +391,7 @@ Track::Ptr getTrackBySdp(const SdpTrack::Ptr &track) { // If there is no sps/pps in the sdp, then it may be possible to recover the sps/pps in the subsequent rtp return std::make_shared(); } - return std::make_shared(sps, pps, 0, 0); + return std::make_shared(sps, pps, prefixSize(sps.data(), sps.size()), prefixSize(pps.data(), pps.size())); } RtpCodec::Ptr getRtpEncoderByCodecId(uint8_t pt) { diff --git a/ext-codec/H265.cpp b/ext-codec/H265.cpp index cf400dfa..906973a0 100644 --- a/ext-codec/H265.cpp +++ b/ext-codec/H265.cpp @@ -392,7 +392,10 @@ Track::Ptr getTrackBySdp(const SdpTrack::Ptr &track) { // If there is no sps/pps in the sdp, then it may be possible to recover sps/pps from the subsequent rtp return std::make_shared(); } - return std::make_shared(vps, sps, pps, 0, 0, 0); + return std::make_shared(vps, sps, pps, + prefixSize(vps.data(), vps.size()), + prefixSize(sps.data(), sps.size()), + prefixSize(pps.data(), pps.size())); } RtpCodec::Ptr getRtpEncoderByCodecId(uint8_t pt) {