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

Side by Side Diff: media/base/clock_impl.cc

Issue 165163: Merge 21882 - Implemented a proper clock for audio/video synchronization.... (Closed) Base URL: svn://chrome-svn/chrome/branches/195/src/
Patch Set: Created 11 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/base/clock_impl.h ('k') | media/base/clock_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:mergeinfo
Merged /trunk/src/media/base/clock_impl.cc:r21882
OLDNEW
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
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
OLDNEW
« no previous file with comments | « media/base/clock_impl.h ('k') | media/base/clock_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698