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

Unified Diff: media/base/channel_mixer.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: media/base/channel_mixer.cc
diff --git a/media/base/channel_mixer.cc b/media/base/channel_mixer.cc
index 3de63fe8bf1582a947d3e82c2fe330c823d5c267..63c6c38328a8c811c99e9020d8a1d78ac37a650f 100644
--- a/media/base/channel_mixer.cc
+++ b/media/base/channel_mixer.cc
@@ -23,7 +23,7 @@ static const float kEqualPowerScale = static_cast<float>(M_SQRT1_2);
static void ValidateLayout(ChannelLayout layout) {
CHECK_NE(layout, CHANNEL_LAYOUT_NONE);
- CHECK_NE(layout, CHANNEL_LAYOUT_MAX);
+ CHECK_LE(layout, CHANNEL_LAYOUT_MAX);
CHECK_NE(layout, CHANNEL_LAYOUT_UNSUPPORTED);
CHECK_NE(layout, CHANNEL_LAYOUT_DISCRETE);
@@ -170,7 +170,7 @@ bool MatrixBuilder::CreateTransformationMatrix(
}
// Route matching channels and figure out which ones aren't accounted for.
- for (Channels ch = LEFT; ch < CHANNELS_MAX;
+ for (Channels ch = LEFT; ch < CHANNELS_MAX + 1;
ch = static_cast<Channels>(ch + 1)) {
int input_ch_index = ChannelOrder(input_layout_, ch);
if (input_ch_index < 0)

Powered by Google App Engine
This is Rietveld 408576698