Fixes for RTP extension time offset.

Review URL: https://webrtc-codereview.appspot.com/720008

git-svn-id: http://webrtc.googlecode.com/svn/trunk@2592 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
mflodman@webrtc.org 2012-08-10 14:30:53 +00:00
parent c0496e66f6
commit ba853c9970
3 changed files with 8 additions and 7 deletions

View File

@ -917,7 +917,7 @@ RTPSender::SendToNetwork(WebRtc_UWord8* buffer,
if (capture_time_ms >= 0) { if (capture_time_ms >= 0) {
ModuleRTPUtility::RTPHeaderParser rtpParser(buffer, length); ModuleRTPUtility::RTPHeaderParser rtpParser(buffer, length);
WebRtcRTPHeader rtp_header; WebRtcRTPHeader rtp_header;
rtpParser.Parse(rtp_header); rtpParser.Parse(rtp_header, &_rtpHeaderExtensionMap);
int64_t time_now = _clock.GetTimeInMS(); int64_t time_now = _clock.GetTimeInMS();
UpdateTransmissionTimeOffset(buffer, length, rtp_header, UpdateTransmissionTimeOffset(buffer, length, rtp_header,
time_now - capture_time_ms); time_now - capture_time_ms);
@ -1172,7 +1172,7 @@ void RTPSender::UpdateTransmissionTimeOffset(
WebRtc_UWord8* rtp_packet, WebRtc_UWord8* rtp_packet,
const WebRtc_UWord16 rtp_packet_length, const WebRtc_UWord16 rtp_packet_length,
const WebRtcRTPHeader& rtp_header, const WebRtcRTPHeader& rtp_header,
const WebRtc_Word64 time_ms) const { const WebRtc_Word64 time_diff_ms) const {
CriticalSectionScoped cs(_sendCritsect); CriticalSectionScoped cs(_sendCritsect);
// Get length until start of transmission block. // Get length until start of transmission block.
@ -1186,7 +1186,8 @@ void RTPSender::UpdateTransmissionTimeOffset(
} }
int block_pos = 12 + rtp_header.header.numCSRCs + transmission_block_pos; int block_pos = 12 + rtp_header.header.numCSRCs + transmission_block_pos;
if ((rtp_packet_length < block_pos + 4)) { if (rtp_packet_length < block_pos + 4 ||
rtp_header.header.headerLength < block_pos + 4) {
WEBRTC_TRACE(kTraceStream, kTraceRtpRtcp, _id, WEBRTC_TRACE(kTraceStream, kTraceRtpRtcp, _id,
"Failed to update transmission time offset, invalid length."); "Failed to update transmission time offset, invalid length.");
return; return;
@ -1219,7 +1220,7 @@ void RTPSender::UpdateTransmissionTimeOffset(
// Update transmission offset field. // Update transmission offset field.
ModuleRTPUtility::AssignUWord24ToBuffer(rtp_packet + block_pos + 1, ModuleRTPUtility::AssignUWord24ToBuffer(rtp_packet + block_pos + 1,
time_ms * 90); // RTP timestamp time_diff_ms * 90); // RTP timestamp.
} }
WebRtc_Word32 WebRtc_Word32

View File

@ -166,7 +166,7 @@ public:
void UpdateTransmissionTimeOffset(WebRtc_UWord8* rtp_packet, void UpdateTransmissionTimeOffset(WebRtc_UWord8* rtp_packet,
const WebRtc_UWord16 rtp_packet_length, const WebRtc_UWord16 rtp_packet_length,
const WebRtcRTPHeader& rtp_header, const WebRtcRTPHeader& rtp_header,
const WebRtc_Word64 time_ms) const; const WebRtc_Word64 time_diff_ms) const;
void SetTransmissionSmoothingStatus(const bool enable); void SetTransmissionSmoothingStatus(const bool enable);

View File

@ -608,7 +608,7 @@ void RTPHeaderParser::ParseOneByteExtensionHeader(
const WebRtc_UWord8* ptrRTPDataExtensionEnd, const WebRtc_UWord8* ptrRTPDataExtensionEnd,
const WebRtc_UWord8* ptr) const { const WebRtc_UWord8* ptr) const {
if (!ptrExtensionMap) { if (!ptrExtensionMap) {
WEBRTC_TRACE(kTraceWarning, kTraceRtpRtcp, -1, "No extension map."); WEBRTC_TRACE(kTraceStream, kTraceRtpRtcp, -1, "No extension map.");
return; return;
} }
@ -676,7 +676,7 @@ void RTPHeaderParser::ParseOneByteExtensionHeader(
break; break;
} }
default: { default: {
WEBRTC_TRACE(kTraceWarning, kTraceRtpRtcp, -1, WEBRTC_TRACE(kTraceStream, kTraceRtpRtcp, -1,
"Extension type not implemented."); "Extension type not implemented.");
return; return;
} }