| 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_controller.h" | 5 #include "media/audio/audio_output_controller.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 void AudioOutputController::DisallowEntryToOnMoreIOData() { | 471 void AudioOutputController::DisallowEntryToOnMoreIOData() { |
| 472 const bool is_zero = !base::AtomicRefCountDec(&num_allowed_io_); | 472 const bool is_zero = !base::AtomicRefCountDec(&num_allowed_io_); |
| 473 DCHECK(is_zero); | 473 DCHECK(is_zero); |
| 474 } | 474 } |
| 475 | 475 |
| 476 void AudioOutputController::WedgeCheck() { | 476 void AudioOutputController::WedgeCheck() { |
| 477 DCHECK(message_loop_->BelongsToCurrentThread()); | 477 DCHECK(message_loop_->BelongsToCurrentThread()); |
| 478 | 478 |
| 479 // If we should be playing and we haven't, that's a wedge. | 479 // If we should be playing and we haven't, that's a wedge. |
| 480 if (state_ == kPlaying) { | 480 if (state_ == kPlaying) { |
| 481 const bool playback_success = | 481 UMA_HISTOGRAM_BOOLEAN("Media.AudioOutputControllerPlaybackStartupSuccess", |
| 482 base::AtomicRefCountIsOne(&on_more_io_data_called_); | 482 base::AtomicRefCountIsOne(&on_more_io_data_called_)); |
| 483 | |
| 484 UMA_HISTOGRAM_BOOLEAN( | |
| 485 "Media.AudioOutputControllerPlaybackStartupSuccess", playback_success); | |
| 486 | |
| 487 // Let the AudioManager try and fix it. | |
| 488 if (!playback_success) | |
| 489 audio_manager_->FixWedgedAudio(); | |
| 490 } | 483 } |
| 491 } | 484 } |
| 492 | 485 |
| 493 } // namespace media | 486 } // namespace media |
| OLD | NEW |