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

Unified Diff: media/cast/net/rtcp/rtcp.cc

Issue 410433002: Cast: Avoid hitting a DCHECK caused by race condition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: flakr Created 6 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/net/rtcp/rtcp.cc
diff --git a/media/cast/net/rtcp/rtcp.cc b/media/cast/net/rtcp/rtcp.cc
index 92abb3ea585287c29a8160d49ba91966a44f12ed..d41a29e2ab90814a639c08a4c3dc7770234c8905 100644
--- a/media/cast/net/rtcp/rtcp.cc
+++ b/media/cast/net/rtcp/rtcp.cc
@@ -159,14 +159,6 @@ void Rtcp::SendRtcpFromRtpReceiver(
uint32 delay_seconds = 0;
uint32 delay_fraction = 0;
base::TimeDelta delta = now - time_last_report_received_;
-
- // TODO(hclam): DLRR is not used by any receiver. Consider removing
- // it. There is one race condition in the computation of the time for
- // DLRR: current time is submitted to this method while
- // |time_last_report_received_| is updated just before that. This can
- // happen if current time is not submitted synchronously.
- if (delta < base::TimeDelta())
- delta = base::TimeDelta();
ConvertTimeToFractions(delta.InMicroseconds(), &delay_seconds,
&delay_fraction);
report_block.delay_since_last_sr =
@@ -202,6 +194,13 @@ void Rtcp::SendRtcpFromRtpSender(base::TimeTicks current_time,
uint32 delay_seconds = 0;
uint32 delay_fraction = 0;
base::TimeDelta delta = current_time - time_last_report_received_;
+ // TODO(hclam): DLRR is not used by any receiver. Consider removing
+ // it. There is one race condition in the computation of the time for
+ // DLRR: current time is submitted to this method while
+ // |time_last_report_received_| is updated just before that. This can
+ // happen if current time is not submitted synchronously.
+ if (delta < base::TimeDelta())
+ delta = base::TimeDelta();
ConvertTimeToFractions(delta.InMicroseconds(), &delay_seconds,
&delay_fraction);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698