修复重复拷贝的bug

This commit is contained in:
xiongziliang 2018-08-20 10:18:04 +08:00
parent 076c45105c
commit 36d1d3aa16
2 changed files with 6 additions and 2 deletions

View File

@ -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++;
}

View File

@ -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++;