Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(644)

Unified Diff: webrtc/modules/rtp_rtcp/source/rtp_sender.cc

Issue 1586523003: Fixed sending Rtp packets with non zero csrcs and certain extensions. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/rtp_rtcp/source/rtp_sender.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_sender.cc b/webrtc/modules/rtp_rtcp/source/rtp_sender.cc
index f4933afdd90e7e7382f148b4410bc8a4747ff878..19d53c5459d07450e19abae44297c1b60aa9c5a0 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_sender.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_sender.cc
@@ -1456,8 +1456,9 @@ bool RTPSender::FindHeaderExtensionPosition(RTPExtensionType type,
HeaderExtension header_extension(type);
- size_t block_pos =
- kRtpHeaderLength + rtp_header.numCSRCs + extension_block_pos;
+ size_t extension_pos =
+ kRtpHeaderLength + rtp_header.numCSRCs * sizeof(uint32_t);
+ size_t block_pos = extension_pos + extension_block_pos;
if (rtp_packet_length < block_pos + header_extension.length ||
rtp_header.headerLength < block_pos + header_extension.length) {
LOG(LS_WARNING) << "Failed to find extension position for " << type
@@ -1466,8 +1467,8 @@ bool RTPSender::FindHeaderExtensionPosition(RTPExtensionType type,
}
// Verify that header contains extension.
- if (!((rtp_packet[kRtpHeaderLength + rtp_header.numCSRCs] == 0xBE) &&
- (rtp_packet[kRtpHeaderLength + rtp_header.numCSRCs + 1] == 0xDE))) {
+ if (!(rtp_packet[extension_pos] == 0xBE &&
+ rtp_packet[extension_pos + 1] == 0xDE)) {
LOG(LS_WARNING) << "Failed to find extension position for " << type
<< "as hdr extension not found.";
return false;
@@ -1494,14 +1495,6 @@ RTPSender::ExtensionStatus RTPSender::VerifyExtension(
rtp_packet_length, rtp_header, &block_pos))
return ExtensionStatus::kError;
- // Verify that header contains extension.
- if (!((rtp_packet[kRtpHeaderLength + rtp_header.numCSRCs] == 0xBE) &&
- (rtp_packet[kRtpHeaderLength + rtp_header.numCSRCs + 1] == 0xDE))) {
- LOG(LS_WARNING)
- << "Failed to update absolute send time, hdr extension not found.";
- return ExtensionStatus::kError;
- }
-
// Verify first byte in block.
const uint8_t first_block_byte = (id << 4) + (extension_length_bytes - 2);
if (rtp_packet[block_pos] != first_block_byte)
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698