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) {