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

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

Issue 1420283022: rtcp::ReportBlock refactored to contain parsing (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 1 month 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 | « webrtc/modules/rtp_rtcp/source/rtcp_packet/report_block_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc b/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
index 22b9477e05343c93e1186a8fb713354c0099b093..1b8c62faaf78d80be2e13fca78eb80b375e1005f 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
@@ -459,7 +459,10 @@ int32_t RTCPSender::AddReportBlock(const RTCPReportBlock& report_block) {
rtcp::ReportBlock* block = &report_blocks_[report_block.remoteSSRC];
block->To(report_block.remoteSSRC);
block->WithFractionLost(report_block.fractionLost);
- block->WithCumulativeLost(report_block.cumulativeLost);
+ if (!block->WithCumulativeLost(report_block.cumulativeLost)) {
+ LOG(LS_WARNING) << "Cumulative lost is oversized.";
+ return -1;
+ }
block->WithExtHighestSeqNum(report_block.extendedHighSeqNum);
block->WithJitter(report_block.jitter);
block->WithLastSr(report_block.lastSR);
@@ -1024,6 +1027,8 @@ int RTCPSender::PrepareRTCP(const FeedbackState& feedback_state,
RTCPReportBlock report_block;
if (PrepareReport(feedback_state, it->first, it->second,
&report_block)) {
+ // TODO(danilchap) AddReportBlock may fail (for 2 different reasons).
+ // Probably it shouldn't be ignored.
AddReportBlock(report_block);
}
}
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_packet/report_block_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698