修复时间戳换算溢出的bug

This commit is contained in:
xiongziliang 2018-11-02 09:17:15 +08:00
parent d7c00e91e0
commit 6e03e5a845

View File

@ -499,7 +499,7 @@ bool RtspPlayer::handleOneRtp(int iTrackidx, unsigned char *pucData, unsigned in
//时间戳 //时间戳
memcpy(&rtppt.timeStamp, pucData+4, 4);//内存对齐 memcpy(&rtppt.timeStamp, pucData+4, 4);//内存对齐
//时间戳转换成毫秒 //时间戳转换成毫秒
rtppt.timeStamp = ntohl(rtppt.timeStamp) * 1000 / track->_samplerate; rtppt.timeStamp = ntohl(rtppt.timeStamp) * 1000L / track->_samplerate;
//ssrc //ssrc
memcpy(&rtppt.ssrc,pucData+8,4);//内存对齐 memcpy(&rtppt.ssrc,pucData+8,4);//内存对齐
rtppt.ssrc = ntohl(rtppt.ssrc); rtppt.ssrc = ntohl(rtppt.ssrc);