From 00334b97eeb504fa4ab974999eb12790b838dac9 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Tue, 30 Oct 2018 17:35:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E6=AD=A5=E5=AE=8C=E6=88=90265?= =?UTF-8?q?=E7=9A=84rtp=E8=A7=A3=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/RtspMuxer/H265RtpCodec.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/RtspMuxer/H265RtpCodec.cpp b/src/RtspMuxer/H265RtpCodec.cpp index b89cb91a..fe823bea 100644 --- a/src/RtspMuxer/H265RtpCodec.cpp +++ b/src/RtspMuxer/H265RtpCodec.cpp @@ -93,7 +93,6 @@ bool H265RtpDecoder::decodeRtp(const RtpPacket::Ptr &rtppack) { const uint8_t *frame = (uint8_t *) rtppack->payload + rtppack->offset; int length = rtppack->length - rtppack->offset; - int nal = H265_TYPE(frame[0]); if (nal > 50){ @@ -108,13 +107,13 @@ bool H265RtpDecoder::decodeRtp(const RtpPacket::Ptr &rtppack) { case 49: { // fragmentation unit (FU) FU fu; - MakeFU(frame[1], fu); + MakeFU(frame[2], fu); if (fu.S == 1) { //FU-A start _h265frame->buffer.assign("\x0\x0\x0\x1", 4); _h265frame->buffer.push_back(fu.type << 1); _h265frame->buffer.push_back(0x01); - _h265frame->buffer.append((char *) frame + 2, length - 2); + _h265frame->buffer.append((char *) frame + 3, length - 3); _h265frame->type = fu.type; _h265frame->timeStamp = rtppack->timeStamp; _h265frame->sequence = rtppack->sequence; @@ -129,14 +128,14 @@ bool H265RtpDecoder::decodeRtp(const RtpPacket::Ptr &rtppack) { _h265frame->sequence = rtppack->sequence; if (fu.E == 1) { //FU-A end - _h265frame->buffer.append((char *) frame + 2, length - 2); + _h265frame->buffer.append((char *) frame + 3, length - 3); _h265frame->timeStamp = rtppack->timeStamp; auto isIDR = _h265frame->keyFrame(); onGetH265(_h265frame); return isIDR; } //FU-A mid - _h265frame->buffer.append((char *) frame + 2, length - 2); + _h265frame->buffer.append((char *) frame + 3, length - 3); return false; }