修复 #66
This commit is contained in:
parent
8dfe2d158c
commit
8453f822b0
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -44,6 +44,9 @@ RtpReceiver::RtpReceiver() {}
|
|||
RtpReceiver::~RtpReceiver() {}
|
||||
|
||||
bool RtpReceiver::handleOneRtp(int track_index,SdpTrack::Ptr &track, unsigned char *rtp_raw_ptr, unsigned int rtp_raw_len) {
|
||||
if(rtp_raw_len < 12){
|
||||
return false;
|
||||
}
|
||||
auto rtp_ptr = _rtp_pool.obtain();
|
||||
auto &rtp = *rtp_ptr;
|
||||
auto length = rtp_raw_len + 4;
|
||||
|
|
@ -109,9 +112,14 @@ bool RtpReceiver::handleOneRtp(int track_index,SdpTrack::Ptr &track, unsigned ch
|
|||
return false;
|
||||
}
|
||||
|
||||
uint8_t padding = 0;
|
||||
if(rtp_raw_ptr[0] & 0x40){
|
||||
padding = rtp_raw_ptr[rtp_raw_len - 1];
|
||||
}
|
||||
|
||||
//设置rtp负载长度
|
||||
rtp.setCapacity(length);
|
||||
rtp.setSize(length);
|
||||
rtp.setSize(length - padding);
|
||||
uint8_t *payload_ptr = (uint8_t *)rtp.data();
|
||||
payload_ptr[0] = '$';
|
||||
payload_ptr[1] = rtp.interleaved;
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ public:
|
|||
uint32_t timeStamp;
|
||||
uint16_t sequence;
|
||||
uint32_t ssrc;
|
||||
uint8_t offset;
|
||||
uint32_t offset;
|
||||
TrackType type;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue