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

Unified Diff: webrtc/modules/rtp_rtcp/test/testAPI/test_api.cc

Issue 2378403004: Resurrected test_api_audio.cc (Closed)
Patch Set: Addressed comments. Created 4 years, 2 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
Index: webrtc/modules/rtp_rtcp/test/testAPI/test_api.cc
diff --git a/webrtc/modules/rtp_rtcp/test/testAPI/test_api.cc b/webrtc/modules/rtp_rtcp/test/testAPI/test_api.cc
index ab666cec2c4c616ab9382c69c154a7f793faf072..437499ac4b919e2239585e7630b5950d0ef5b393 100644
--- a/webrtc/modules/rtp_rtcp/test/testAPI/test_api.cc
+++ b/webrtc/modules/rtp_rtcp/test/testAPI/test_api.cc
@@ -44,7 +44,7 @@ bool LoopBackTransport::SendRtp(const uint8_t* data,
}
RTPHeader header;
std::unique_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create());
- if (!parser->Parse(static_cast<const uint8_t*>(data), len, &header)) {
+ if (!parser->Parse(data, len, &header)) {
return false;
}
PayloadUnion payload_specific;
@@ -52,9 +52,11 @@ bool LoopBackTransport::SendRtp(const uint8_t* data,
&payload_specific)) {
return false;
}
+ const uint8_t* payload = data + header.headerLength;
+ RTC_DCHECK_GE(len, header.headerLength);
hlundin-webrtc 2016/10/04 13:45:02 This is test code, so you might just as well RTC_C
ossu 2016/10/04 14:55:29 Alright.
+ const size_t payload_length = len - header.headerLength;
receive_statistics_->IncomingPacket(header, len, false);
- if (!rtp_receiver_->IncomingRtpPacket(header,
- static_cast<const uint8_t*>(data), len,
+ if (!rtp_receiver_->IncomingRtpPacket(header, payload, payload_length,
payload_specific, true)) {
return false;
}

Powered by Google App Engine
This is Rietveld 408576698