diff --git a/device/mpp/sample/venc/rtp.c b/device/mpp/sample/venc/rtp.c index c7736e2..315f17b 100644 --- a/device/mpp/sample/venc/rtp.c +++ b/device/mpp/sample/venc/rtp.c @@ -163,6 +163,8 @@ int Pack264AndSend(unsigned char *frame,int size,RtspClient * p){ identifier.FUType = frame[4]&0x1f; //sps or pps identifier.NRI = (frame[4]&0xe0)>>5; identifier.F = 0; + rtspInterleavedFrameHeader.length = htons(size - 5 + sizeof(FuIdentifier) + sizeof(CRtpHeader) ); + int index = 0; memcpy(sendBuf,&rtspInterleavedFrameHeader,sizeof(rtspInterleavedFrameHeader)); index += sizeof(rtspInterleavedFrameHeader); @@ -191,7 +193,8 @@ int Pack264AndSend(unsigned char *frame,int size,RtspClient * p){ rtspInterleavedFrameHeader.length = htons(MAX_RTP_LEN + sizeof(CH264NalUnit) + sizeof(CRtpHeader)); }else{ sendLength = (size - 5)%MAX_RTP_LEN + sizeof(CH264NalUnit) + sizeof(CRtpHeader) + sizeof(RtspInterleavedFrameHeader); - rtspInterleavedFrameHeader.length = htons((size - 5)%MAX_RTP_LEN + sizeof(CH264NalUnit) + sizeof(CRtpHeader)); + printf("last package send %d length\r\n",sendLength); + rtspInterleavedFrameHeader.length = htons((size - 5)%MAX_RTP_LEN + sizeof(CH264NalUnit) + sizeof(CRtpHeader)); } nalUnit.Header.End = 1; nalUnit.Header.Start = 0;