| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/logging.h" | 5 #include "base/logging.h" |
| 6 #include "media/base/clock_impl.h" | 6 #include "media/base/clock_impl.h" |
| 7 | 7 |
| 8 namespace media { | 8 namespace media { |
| 9 | 9 |
| 10 ClockImpl::ClockImpl(TimeProvider* time_provider) | 10 ClockImpl::ClockImpl(TimeProvider* time_provider) |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 | 56 |
| 57 base::TimeDelta ClockImpl::ElapsedViaProvidedTime( | 57 base::TimeDelta ClockImpl::ElapsedViaProvidedTime( |
| 58 const base::Time& time) const { | 58 const base::Time& time) const { |
| 59 // TODO(scherkus): floating point badness scaling time by playback rate. | 59 // TODO(scherkus): floating point badness scaling time by playback rate. |
| 60 int64 now_us = (time - reference_).InMicroseconds(); | 60 int64 now_us = (time - reference_).InMicroseconds(); |
| 61 now_us = static_cast<int64>(now_us * playback_rate_); | 61 now_us = static_cast<int64>(now_us * playback_rate_); |
| 62 return media_time_ + base::TimeDelta::FromMicroseconds(now_us); | 62 return media_time_ + base::TimeDelta::FromMicroseconds(now_us); |
| 63 } | 63 } |
| 64 | 64 |
| 65 } // namespace media | 65 } // namespace media |
| OLD | NEW |