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

Side by Side Diff: media/filters/audio_clock.cc

Issue 1542013004: Switch to standard integer types in media/, take 2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more stddef Created 4 years, 12 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
« no previous file with comments | « media/filters/audio_clock.h ('k') | media/filters/audio_clock_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "media/filters/audio_clock.h" 5 #include "media/filters/audio_clock.h"
6 6
7 #include <stddef.h>
8
7 #include <algorithm> 9 #include <algorithm>
8 10
9 #include "base/logging.h" 11 #include "base/logging.h"
10 12
11 namespace media { 13 namespace media {
12 14
13 AudioClock::AudioClock(base::TimeDelta start_timestamp, int sample_rate) 15 AudioClock::AudioClock(base::TimeDelta start_timestamp, int sample_rate)
14 : start_timestamp_(start_timestamp), 16 : start_timestamp_(start_timestamp),
15 microseconds_per_frame_( 17 microseconds_per_frame_(
16 static_cast<double>(base::Time::kMicrosecondsPerSecond) / 18 static_cast<double>(base::Time::kMicrosecondsPerSecond) /
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 180
179 base::TimeDelta AudioClock::ComputeBufferedMediaDuration() const { 181 base::TimeDelta AudioClock::ComputeBufferedMediaDuration() const {
180 double scaled_frames = 0; 182 double scaled_frames = 0;
181 for (const auto& buffer : buffered_) 183 for (const auto& buffer : buffered_)
182 scaled_frames += buffer.frames * buffer.playback_rate; 184 scaled_frames += buffer.frames * buffer.playback_rate;
183 return base::TimeDelta::FromMicroseconds(scaled_frames * 185 return base::TimeDelta::FromMicroseconds(scaled_frames *
184 microseconds_per_frame_); 186 microseconds_per_frame_);
185 } 187 }
186 188
187 } // namespace media 189 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/audio_clock.h ('k') | media/filters/audio_clock_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698