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

Unified Diff: content/renderer/media/webrtc_audio_capturer.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_capturer.cc
diff --git a/content/renderer/media/webrtc_audio_capturer.cc b/content/renderer/media/webrtc_audio_capturer.cc
index 561965ebd803b603639085b9a0f0e2304b8a6777..59006bbd423dd82f623f7d7aff62db61a818d95e 100644
--- a/content/renderer/media/webrtc_audio_capturer.cc
+++ b/content/renderer/media/webrtc_audio_capturer.cc
@@ -152,7 +152,7 @@ bool WebRtcAudioCapturer::Initialize() {
device_info_.device.input.channel_layout);
DVLOG(1) << "Audio input hardware channel layout: " << channel_layout;
UMA_HISTOGRAM_ENUMERATION("WebRTC.AudioInputChannelLayout",
- channel_layout, media::CHANNEL_LAYOUT_MAX);
+ channel_layout, media::CHANNEL_LAYOUT_MAX + 1);
// Verify that the reported input channel configuration is supported.
if (channel_layout != media::CHANNEL_LAYOUT_MONO &&
@@ -164,11 +164,10 @@ bool WebRtcAudioCapturer::Initialize() {
DVLOG(1) << "Audio input hardware sample rate: "
<< device_info_.device.input.sample_rate;
- media::AudioSampleRate asr = media::AsAudioSampleRate(
- device_info_.device.input.sample_rate);
- if (asr != media::kUnexpectedAudioSampleRate) {
+ media::AudioSampleRate asr;
+ if (media::ToAudioSampleRate(device_info_.device.input.sample_rate, &asr)) {
UMA_HISTOGRAM_ENUMERATION(
- "WebRTC.AudioInputSampleRate", asr, media::kUnexpectedAudioSampleRate);
+ "WebRTC.AudioInputSampleRate", asr, media::kAudioSampleRateMax + 1);
} else {
UMA_HISTOGRAM_COUNTS("WebRTC.AudioInputSampleRateUnexpected",
device_info_.device.input.sample_rate);

Powered by Google App Engine
This is Rietveld 408576698