Chromium Code Reviews| 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); |
|
Alpha Left Google
2014/08/19 18:01:36
Why this change? This isn't listed in the CL descr
hubbe
2014/08/19 18:27:16
Because the test I added exposed this bug.
I'll ad
|
| 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); |