Commit e11fde32 authored by hclam@chromium.org's avatar hclam@chromium.org

Cast: Avoid hitting a DCHECK caused by race condition

RTCP sender report has a race condition when then current time is
submitted asynchronously (from another process). This caused the value
for DLRR to be negative.

This code is going to be removed it is fine to just suppress this
condition.

BUG=393042
NOTRY=true

Review URL: https://codereview.chromium.org/410433002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284521 0039d316-1c4b-4281-b951-d872f2087c98
parent d983bd12
...@@ -159,14 +159,6 @@ void Rtcp::SendRtcpFromRtpReceiver( ...@@ -159,14 +159,6 @@ void Rtcp::SendRtcpFromRtpReceiver(
uint32 delay_seconds = 0; uint32 delay_seconds = 0;
uint32 delay_fraction = 0; uint32 delay_fraction = 0;
base::TimeDelta delta = now - time_last_report_received_; 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, ConvertTimeToFractions(delta.InMicroseconds(), &delay_seconds,
&delay_fraction); &delay_fraction);
report_block.delay_since_last_sr = report_block.delay_since_last_sr =
...@@ -202,6 +194,13 @@ void Rtcp::SendRtcpFromRtpSender(base::TimeTicks current_time, ...@@ -202,6 +194,13 @@ void Rtcp::SendRtcpFromRtpSender(base::TimeTicks current_time,
uint32 delay_seconds = 0; uint32 delay_seconds = 0;
uint32 delay_fraction = 0; uint32 delay_fraction = 0;
base::TimeDelta delta = current_time - time_last_report_received_; 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, ConvertTimeToFractions(delta.InMicroseconds(), &delay_seconds,
&delay_fraction); &delay_fraction);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment