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

Unified Diff: content/renderer/media/webrtc_audio_renderer.cc

Issue 148553003: Clean up histogram'd media enum max values. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/webrtc_audio_renderer.cc
diff --git a/content/renderer/media/webrtc_audio_renderer.cc b/content/renderer/media/webrtc_audio_renderer.cc
index 825a4e8f456220e8b3bca75a77474df9763c135c..d3e866d5358bfb2b7005014d30650ece3a0c17fe 100644
--- a/content/renderer/media/webrtc_audio_renderer.cc
+++ b/content/renderer/media/webrtc_audio_renderer.cc
@@ -222,10 +222,10 @@ bool WebRtcAudioRenderer::Initialize(WebRtcAudioRendererSource* source) {
DVLOG(1) << "Resampling from 48000 to 192000 is required";
sample_rate = 48000;
}
- media::AudioSampleRate asr = media::AsAudioSampleRate(sample_rate);
- if (asr != media::kUnexpectedAudioSampleRate) {
+ media::AudioSampleRate asr;
+ if (media::ToAudioSampleRate(sample_rate, &asr)) {
UMA_HISTOGRAM_ENUMERATION(
- "WebRTC.AudioOutputSampleRate", asr, media::kUnexpectedAudioSampleRate);
+ "WebRTC.AudioOutputSampleRate", asr, media::kAudioSampleRateMax + 1);
} else {
UMA_HISTOGRAM_COUNTS("WebRTC.AudioOutputSampleRateUnexpected", sample_rate);
}
@@ -330,7 +330,7 @@ bool WebRtcAudioRenderer::Initialize(WebRtcAudioRendererSource* source) {
UMA_HISTOGRAM_ENUMERATION("WebRTC.AudioOutputChannelLayout",
source_params.channel_layout(),
- media::CHANNEL_LAYOUT_MAX);
+ media::CHANNEL_LAYOUT_MAX + 1);
UMA_HISTOGRAM_ENUMERATION("WebRTC.AudioOutputFramesPerBuffer",
source_params.frames_per_buffer(),
kUnexpectedAudioBufferSize);

Powered by Google App Engine
This is Rietveld 408576698