| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 DLOG(ERROR) << "Unable to open audio device in low latency mode. Falling " | 320 DLOG(ERROR) << "Unable to open audio device in low latency mode. Falling " |
| 321 << "back to high latency audio output."; | 321 << "back to high latency audio output."; |
| 322 | 322 |
| 323 SetupFallbackParams(); | 323 SetupFallbackParams(); |
| 324 if (dispatcher_->OpenStream()) { | 324 if (dispatcher_->OpenStream()) { |
| 325 streams_opened_ = true; | 325 streams_opened_ = true; |
| 326 return true; | 326 return true; |
| 327 } | 327 } |
| 328 #endif | 328 #endif |
| 329 | 329 |
| 330 DLOG(ERROR) << "Unable to open audio device in high latency mode. Falling " | 330 LOG(ERROR) << "Unable to open audio device in high latency mode. Falling " |
| 331 << "back to fake audio output."; | 331 << "back to fake audio output."; |
| 332 | 332 |
| 333 // Finally fall back to a fake audio output device. | 333 // Finally fall back to a fake audio output device. |
| 334 output_params_ = params_; | 334 output_params_ = params_; |
| 335 output_params_.set_format(AudioParameters::AUDIO_FAKE); | 335 output_params_.set_format(AudioParameters::AUDIO_FAKE); |
| 336 | 336 |
| 337 Initialize(); | 337 Initialize(); |
| 338 if (dispatcher_->OpenStream()) { | 338 if (dispatcher_->OpenStream()) { |
| 339 streams_opened_ = true; | 339 streams_opened_ = true; |
| 340 return true; | 340 return true; |
| 341 } | 341 } |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 dest->ZeroFramesPartial(frames, dest->frames() - frames); | 495 dest->ZeroFramesPartial(frames, dest->frames() - frames); |
| 496 return frames > 0 ? 1 : 0; | 496 return frames > 0 ? 1 : 0; |
| 497 } | 497 } |
| 498 | 498 |
| 499 void OnMoreDataConverter::OnError(AudioOutputStream* stream) { | 499 void OnMoreDataConverter::OnError(AudioOutputStream* stream) { |
| 500 error_occurred_ = true; | 500 error_occurred_ = true; |
| 501 source_callback_->OnError(stream); | 501 source_callback_->OnError(stream); |
| 502 } | 502 } |
| 503 | 503 |
| 504 } // namespace media | 504 } // namespace media |
| OLD | NEW |