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

Side by Side Diff: media/audio/audio_output_resampler.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/audio_output_device_unittest.cc ('k') | media/audio/audio_parameters.h » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/audio/audio_output_resampler.h" 5 #include "media/audio/audio_output_resampler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 return true; 214 return true;
215 } 215 }
216 #endif 216 #endif
217 217
218 DLOG(ERROR) << "Unable to open audio device in high latency mode. Falling " 218 DLOG(ERROR) << "Unable to open audio device in high latency mode. Falling "
219 << "back to fake audio output."; 219 << "back to fake audio output.";
220 220
221 // Finally fall back to a fake audio output device. 221 // Finally fall back to a fake audio output device.
222 output_params_.Reset( 222 output_params_.Reset(
223 AudioParameters::AUDIO_FAKE, params_.channel_layout(), 223 AudioParameters::AUDIO_FAKE, params_.channel_layout(),
224 params_.channels(), params_.input_channels(), params_.sample_rate(), 224 params_.channels(), params_.sample_rate(),
225 params_.bits_per_sample(), params_.frames_per_buffer()); 225 params_.bits_per_sample(), params_.frames_per_buffer());
226 Initialize(); 226 Initialize();
227 if (dispatcher_->OpenStream()) { 227 if (dispatcher_->OpenStream()) {
228 streams_opened_ = true; 228 streams_opened_ = true;
229 return true; 229 return true;
230 } 230 }
231 231
232 return false; 232 return false;
233 } 233 }
234 234
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 if (frames > 0 && frames < dest->frames()) 354 if (frames > 0 && frames < dest->frames())
355 dest->ZeroFramesPartial(frames, dest->frames() - frames); 355 dest->ZeroFramesPartial(frames, dest->frames() - frames);
356 return frames > 0 ? 1 : 0; 356 return frames > 0 ? 1 : 0;
357 } 357 }
358 358
359 void OnMoreDataConverter::OnError(AudioOutputStream* stream) { 359 void OnMoreDataConverter::OnError(AudioOutputStream* stream) {
360 source_callback_->OnError(stream); 360 source_callback_->OnError(stream);
361 } 361 }
362 362
363 } // namespace media 363 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/audio_output_device_unittest.cc ('k') | media/audio/audio_parameters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698