summaryrefslogtreecommitdiffstats
path: root/media/audio/mac
diff options
context:
space:
mode:
authortommi <tommi@chromium.org>2015-10-30 01:27:14 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-30 08:28:06 +0000
commit0e50da17dca886a454fbf36774051d2efe5acea7 (patch)
tree44b013670558238115a07c155ec404ad9a928efb /media/audio/mac
parent1a2715c7977a7b70c6500ed09a51d3f19da99fbc (diff)
downloadchromium_src-0e50da17dca886a454fbf36774051d2efe5acea7.zip
chromium_src-0e50da17dca886a454fbf36774051d2efe5acea7.tar.gz
chromium_src-0e50da17dca886a454fbf36774051d2efe5acea7.tar.bz2
Fix overreporting of '0' stats in the Mac audio rendering code.
BUG=543522 Review URL: https://codereview.chromium.org/1418453004 Cr-Commit-Position: refs/heads/master@{#357063}
Diffstat (limited to 'media/audio/mac')
-rw-r--r--media/audio/mac/audio_auhal_mac.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/media/audio/mac/audio_auhal_mac.cc b/media/audio/mac/audio_auhal_mac.cc
index 1960f14..bd3bd83 100644
--- a/media/audio/mac/audio_auhal_mac.cc
+++ b/media/audio/mac/audio_auhal_mac.cc
@@ -149,8 +149,6 @@ void AUHALStream::Start(AudioSourceCallback* callback) {
return;
}
- ReportAndResetStats();
-
stopped_ = false;
audio_fifo_.reset();
{
@@ -179,6 +177,8 @@ void AUHALStream::Stop() {
if (result != noErr)
source_->OnError(this);
+ ReportAndResetStats();
+
base::AutoLock auto_lock(source_lock_);
source_ = NULL;
stopped_ = true;
@@ -371,12 +371,16 @@ void AUHALStream::UpdatePlayoutTimestamp(const AudioTimeStamp* timestamp) {
}
void AUHALStream::ReportAndResetStats() {
+ if (!last_sample_time_)
+ return; // No stats gathered to report.
+
// A value of 0 indicates that we got the buffer size we asked for.
UMA_HISTOGRAM_COUNTS("Media.Audio.Render.FramesRequested",
number_of_frames_requested_);
// Even if there aren't any glitches, we want to record it to get a feel for
// how often we get no glitches vs the alternative.
- UMA_HISTOGRAM_COUNTS("Media.Audio.Render.Glitches", glitches_detected_);
+ UMA_HISTOGRAM_CUSTOM_COUNTS("Media.Audio.Render.Glitches", glitches_detected_,
+ 0, 999999, 100);
if (glitches_detected_ != 0) {
auto lost_frames_ms = (total_lost_frames_ * 1000) / params_.sample_rate();