From 36d1d3aa16b10dd7cedea7da0a498a874120cc00 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Mon, 20 Aug 2018 10:18:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=87=8D=E5=A4=8D=E6=8B=B7?= =?UTF-8?q?=E8=B4=9D=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/RTP/RtpMakerAAC.cpp | 4 +++- src/RTP/RtpMakerH264.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/RTP/RtpMakerAAC.cpp b/src/RTP/RtpMakerAAC.cpp index a8af0bb2..47b3037c 100644 --- a/src/RTP/RtpMakerAAC.cpp +++ b/src/RTP/RtpMakerAAC.cpp @@ -82,7 +82,9 @@ inline void RtpMaker_AAC::makeAACRtp(const void *pData, unsigned int uiLen, bool memcpy(&pucRtp[8], &ts, 4); //ssrc memcpy(&pucRtp[12], &sc, 4); + //playload memcpy(&pucRtp[16], pData, uiLen); + rtppkt.PT = m_ui8PlayloadType; rtppkt.interleaved = m_ui8Interleaved; rtppkt.mark = bMark; @@ -92,7 +94,7 @@ inline void RtpMaker_AAC::makeAACRtp(const void *pData, unsigned int uiLen, bool rtppkt.ssrc = m_ui32Ssrc; rtppkt.type = TrackAudio; rtppkt.offset = 16; - memcpy(rtppkt.payload + 16, pData, uiLen); + onMakeRtp(pRtppkt, false); m_ui16Sequence++; } diff --git a/src/RTP/RtpMakerH264.cpp b/src/RTP/RtpMakerH264.cpp index dbbcf41a..e25b8f38 100644 --- a/src/RTP/RtpMakerH264.cpp +++ b/src/RTP/RtpMakerH264.cpp @@ -99,7 +99,9 @@ inline void RtpMaker_H264::makeH264Rtp(const void* data, unsigned int len, bool memcpy(&pucRtp[8], &ts, 4); //ssrc memcpy(&pucRtp[12], &sc, 4); + //playload memcpy(&pucRtp[16], data, len); + rtppkt.PT = m_ui8PlayloadType; rtppkt.interleaved = m_ui8Interleaved; rtppkt.mark = mark; @@ -109,7 +111,7 @@ inline void RtpMaker_H264::makeH264Rtp(const void* data, unsigned int len, bool rtppkt.ssrc = m_ui32Ssrc; rtppkt.type = TrackVideo; rtppkt.offset = 16; - memcpy(rtppkt.payload + 16, data, len); + uint8_t type = ((uint8_t *) (data))[0] & 0x1F; onMakeRtp(pRtppkt, type == 5); m_ui16Sequence++;