summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlpha Lam <hclam@chromium.org>2014-09-10 15:08:45 -0700
committerAlpha Lam <hclam@chromium.org>2014-09-10 22:12:35 +0000
commitb1fdeddc4f1520d711618f5bbb62527d97c25121 (patch)
tree822041d2e7f89c56175da47474730f328d72338e
parent1027848c2ac7f12e6788201dc532ac25f1b986f1 (diff)
downloadchromium_src-b1fdeddc4f1520d711618f5bbb62527d97c25121.zip
chromium_src-b1fdeddc4f1520d711618f5bbb62527d97c25121.tar.gz
chromium_src-b1fdeddc4f1520d711618f5bbb62527d97c25121.tar.bz2
Merge: Cast: Reject Old RTCP Packets
Merging only media/cast/sender/congestion_control.cc in r290667 to branch 2125. BUG=412550 R=hubbe@chromium.org Review URL: https://codereview.chromium.org/565463004 Cr-Commit-Position: refs/branch-heads/2125@{#307} Cr-Branched-From: b68026d94bda36dd106a3d91a098719f952a9477-refs/heads/master@{#290040}
-rw-r--r--media/cast/sender/congestion_control.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/media/cast/sender/congestion_control.cc b/media/cast/sender/congestion_control.cc
index 70fcfe9..9efe50a 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);