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

Unified Diff: media/cast/sender/congestion_control.cc

Issue 480563004: Cast: Reject old RTCP packets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 6 years, 4 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 | « media/cast/net/rtcp/rtcp.cc ('k') | media/cast/test/end2end_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/sender/congestion_control.cc
diff --git a/media/cast/sender/congestion_control.cc b/media/cast/sender/congestion_control.cc
index 70fcfe9dc99baf9ef81734ce203f7c42f294589b..9efe50adbf823f8d6c98d2a56599a8d8dbc78ffb 100644
--- a/media/cast/sender/congestion_control.cc
+++ b/media/cast/sender/congestion_control.cc
@@ -113,9 +113,16 @@ void CongestionControl::AckFrame(uint32 frame_id, base::TimeTicks when) {
FrameStats* frame_stats = GetFrameStats(last_acked_frame_);
while (IsNewerFrameId(frame_id, last_acked_frame_)) {
FrameStats* last_frame_stats = frame_stats;
- last_acked_frame_++;
- frame_stats = GetFrameStats(last_acked_frame_);
+ frame_stats = GetFrameStats(last_acked_frame_ + 1);
DCHECK(frame_stats);
+ if (frame_stats->sent_time.is_null()) {
+ // Can't ack a frame that hasn't been sent yet.
+ return;
+ }
+ last_acked_frame_++;
+ if (when < frame_stats->sent_time)
+ when = frame_stats->sent_time;
+
frame_stats->ack_time = when;
acked_bits_in_history_ += frame_stats->frame_size;
dead_time_in_history_ += DeadTime(*last_frame_stats, *frame_stats);
« no previous file with comments | « media/cast/net/rtcp/rtcp.cc ('k') | media/cast/test/end2end_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698