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

Unified Diff: media/filters/audio_renderer_algorithm.cc

Issue 1094783002: Switch to double for time calculations using playback rate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Making changes at chromecast side to fix trybots Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/audio_renderer_algorithm.h ('k') | media/filters/audio_renderer_algorithm_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/audio_renderer_algorithm.cc
diff --git a/media/filters/audio_renderer_algorithm.cc b/media/filters/audio_renderer_algorithm.cc
index 16e903c6a3b62f9dd5b190dd8565afca9457ca76..0d59d398d826f9c9d6e5cc80e3dbc45fc2186fcc 100644
--- a/media/filters/audio_renderer_algorithm.cc
+++ b/media/filters/audio_renderer_algorithm.cc
@@ -49,8 +49,8 @@ namespace media {
// Max/min supported playback rates for fast/slow audio. Audio outside of these
// ranges are muted.
// Audio at these speeds would sound better under a frequency domain algorithm.
-static const float kMinPlaybackRate = 0.5f;
-static const float kMaxPlaybackRate = 4.0f;
+static const double kMinPlaybackRate = 0.5;
+static const double kMaxPlaybackRate = 4.0;
// Overlap-and-add window size in milliseconds.
static const int kOlaWindowSizeMs = 20;
@@ -144,7 +144,7 @@ void AudioRendererAlgorithm::Initialize(const AudioParameters& params) {
int AudioRendererAlgorithm::FillBuffer(AudioBus* dest,
int dest_offset,
int requested_frames,
- float playback_rate) {
+ double playback_rate) {
if (playback_rate == 0)
return 0;
@@ -237,7 +237,7 @@ bool AudioRendererAlgorithm::CanPerformWsola() const {
search_block_index_ + search_block_size <= frames;
}
-bool AudioRendererAlgorithm::RunOneWsolaIteration(float playback_rate) {
+bool AudioRendererAlgorithm::RunOneWsolaIteration(double playback_rate) {
if (!CanPerformWsola())
return false;
@@ -263,7 +263,7 @@ bool AudioRendererAlgorithm::RunOneWsolaIteration(float playback_rate) {
return true;
}
-void AudioRendererAlgorithm::UpdateOutputTime(float playback_rate,
+void AudioRendererAlgorithm::UpdateOutputTime(double playback_rate,
double time_change) {
output_time_ += time_change;
// Center of the search region, in frames.
@@ -272,7 +272,7 @@ void AudioRendererAlgorithm::UpdateOutputTime(float playback_rate,
search_block_index_ = search_block_center_index - search_block_center_offset_;
}
-void AudioRendererAlgorithm::RemoveOldInputFrames(float playback_rate) {
+void AudioRendererAlgorithm::RemoveOldInputFrames(double playback_rate) {
const int earliest_used_index = std::min(target_block_index_,
search_block_index_);
if (earliest_used_index <= 0)
« no previous file with comments | « media/filters/audio_renderer_algorithm.h ('k') | media/filters/audio_renderer_algorithm_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698