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

Unified Diff: media/base/audio_timestamp_helper.cc

Issue 2562243005: Make AudioTimestampHelper::TimeToFrames() more accurate (Closed)
Patch Set: Modified unittests. Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/base/audio_timestamp_helper_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/audio_timestamp_helper.cc
diff --git a/media/base/audio_timestamp_helper.cc b/media/base/audio_timestamp_helper.cc
index 8694ae329a003aed933cccba44429941c7305457..0d62c125b75737d2cedf1df3523158e9d67a1914 100644
--- a/media/base/audio_timestamp_helper.cc
+++ b/media/base/audio_timestamp_helper.cc
@@ -20,7 +20,7 @@ base::TimeDelta AudioTimestampHelper::FramesToTime(int64_t frames,
// static
int64_t AudioTimestampHelper::TimeToFrames(base::TimeDelta time,
int samples_per_second) {
- return time.InSecondsF() * samples_per_second;
+ return std::round(time.InSecondsF() * samples_per_second);
}
AudioTimestampHelper::AudioTimestampHelper(int samples_per_second)
« no previous file with comments | « no previous file | media/base/audio_timestamp_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698