| Index: media/base/wall_clock_time_source.cc
|
| diff --git a/media/base/wall_clock_time_source.cc b/media/base/wall_clock_time_source.cc
|
| index 036930671babe5bcac3cafc19f137c543c84ac94..bb5074936e82855b1433d82529aa4791912102cf 100644
|
| --- a/media/base/wall_clock_time_source.cc
|
| +++ b/media/base/wall_clock_time_source.cc
|
| @@ -60,15 +60,27 @@ base::TimeDelta WallClockTimeSource::CurrentMediaTime() {
|
| return CurrentMediaTime_Locked();
|
| }
|
|
|
| -base::TimeTicks WallClockTimeSource::GetWallClockTime(base::TimeDelta time) {
|
| - base::AutoLock auto_lock(lock_);
|
| - if (!ticking_ || playback_rate_ == 0.0)
|
| +base::TimeTicks WallClockTimeSource::GetWallClockTime(base::TimeDelta time,
|
| + int request_flags) {
|
| + if (request_flags & SUSPEND_TIME)
|
| + lock_.Acquire();
|
| +
|
| + lock_.AssertAcquired();
|
| + if (!ticking_ || playback_rate_ == 0.0) {
|
| + lock_.Release();
|
| return base::TimeTicks();
|
| + }
|
|
|
| // See notes about |time| values less than |base_time_| in TimeSource header.
|
| - return reference_wall_ticks_ +
|
| - base::TimeDelta::FromMicroseconds(
|
| - (time - base_time_).InMicroseconds() / playback_rate_);
|
| + const base::TimeTicks result =
|
| + reference_wall_ticks_ +
|
| + base::TimeDelta::FromMicroseconds((time - base_time_).InMicroseconds() /
|
| + playback_rate_);
|
| +
|
| + if (request_flags & RESUME_TIME)
|
| + lock_.Release();
|
| +
|
| + return result;
|
| }
|
|
|
| void WallClockTimeSource::SetTickClockForTesting(
|
|
|