OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |