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

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

Issue 518433002: Revert of Revert of Remove the last piece of deprecated synchronous IO code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 3 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/audio/win/core_audio_util_win.cc ('k') | media/base/audio_buffer_converter_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/base/audio_buffer_converter.h" 5 #include "media/base/audio_buffer_converter.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "media/base/audio_buffer.h" 10 #include "media/base/audio_buffer.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 } 135 }
136 136
137 void AudioBufferConverter::ResetConverter( 137 void AudioBufferConverter::ResetConverter(
138 const scoped_refptr<AudioBuffer>& buffer) { 138 const scoped_refptr<AudioBuffer>& buffer) {
139 Flush(); 139 Flush();
140 audio_converter_.reset(); 140 audio_converter_.reset();
141 input_params_.Reset( 141 input_params_.Reset(
142 input_params_.format(), 142 input_params_.format(),
143 buffer->channel_layout(), 143 buffer->channel_layout(),
144 buffer->channel_count(), 144 buffer->channel_count(),
145 0,
146 buffer->sample_rate(), 145 buffer->sample_rate(),
147 input_params_.bits_per_sample(), 146 input_params_.bits_per_sample(),
148 // If resampling is needed and the FIFO disabled, the AudioConverter will 147 // If resampling is needed and the FIFO disabled, the AudioConverter will
149 // always request SincResampler::kDefaultRequestSize frames. Otherwise it 148 // always request SincResampler::kDefaultRequestSize frames. Otherwise it
150 // will use the output frame size. 149 // will use the output frame size.
151 buffer->sample_rate() == output_params_.sample_rate() 150 buffer->sample_rate() == output_params_.sample_rate()
152 ? output_params_.frames_per_buffer() 151 ? output_params_.frames_per_buffer()
153 : SincResampler::kDefaultRequestSize); 152 : SincResampler::kDefaultRequestSize);
154 153
155 io_sample_rate_ratio_ = static_cast<double>(input_params_.sample_rate()) / 154 io_sample_rate_ratio_ = static_cast<double>(input_params_.sample_rate()) /
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 is_flushing_ = false; 239 is_flushing_ = false;
241 audio_converter_->Reset(); 240 audio_converter_->Reset();
242 DCHECK_EQ(input_frames_, 0); 241 DCHECK_EQ(input_frames_, 0);
243 DCHECK_EQ(last_input_buffer_offset_, 0); 242 DCHECK_EQ(last_input_buffer_offset_, 0);
244 DCHECK_LT(buffered_input_frames_, 1.0); 243 DCHECK_LT(buffered_input_frames_, 1.0);
245 DCHECK(queued_inputs_.empty()); 244 DCHECK(queued_inputs_.empty());
246 buffered_input_frames_ = 0.0; 245 buffered_input_frames_ = 0.0;
247 } 246 }
248 247
249 } // namespace media 248 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/win/core_audio_util_win.cc ('k') | media/base/audio_buffer_converter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698