diff options
-rw-r--r-- | media/audio/audio_util.cc | 11 | ||||
-rw-r--r-- | media/audio/audio_util_unittest.cc | 8 |
2 files changed, 8 insertions, 11 deletions
diff --git a/media/audio/audio_util.cc b/media/audio/audio_util.cc index 8774a72..9f4e6da 100644 --- a/media/audio/audio_util.cc +++ b/media/audio/audio_util.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -33,12 +33,9 @@ void AdjustVolume(Format* buf_out, } } -// Channel order for AAC -// From http://www.hydrogenaudio.org/forums/lofiversion/index.php/t40046.html - -static const int kChannel_C = 0; -static const int kChannel_L = 1; -static const int kChannel_R = 2; +static const int kChannel_L = 0; +static const int kChannel_R = 1; +static const int kChannel_C = 2; template<class Fixed, int min_value, int max_value> static int AddChannel(int val, diff --git a/media/audio/audio_util_unittest.cc b/media/audio/audio_util_unittest.cc index c0ed0fc..6d5ad74 100644 --- a/media/audio/audio_util_unittest.cc +++ b/media/audio/audio_util_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -81,7 +81,7 @@ TEST(AudioUtilTest, AdjustVolume_s32) { TEST(AudioUtilTest, FoldChannels_u8) { // Test FoldChannels() on 8 bit samples. - uint8 samples_u8[6] = { 130, 100, 150, 70, 130, 170 }; + uint8 samples_u8[6] = { 100, 150, 130, 70, 130, 170 }; uint8 expected_u8[2] = { static_cast<uint8>((130 - 128) * 0.707 + (100 - 128) + 128), static_cast<uint8>((130 - 128) * 0.707 + @@ -97,7 +97,7 @@ TEST(AudioUtilTest, FoldChannels_u8) { TEST(AudioUtilTest, FoldChannels_s16) { // Test FoldChannels() on 16 bit samples. - int16 samples_s16[6] = { 12, 1, 3, 7, 13, 17 }; + int16 samples_s16[6] = { 1, 3, 12, 7, 13, 17 }; int16 expected_s16[2] = { static_cast<int16>(12 * .707 + 1), static_cast<int16>(12 * .707 + 3) }; bool result_s16 = media::FoldChannels(samples_s16, sizeof(samples_s16), @@ -111,7 +111,7 @@ TEST(AudioUtilTest, FoldChannels_s16) { TEST(AudioUtilTest, FoldChannels_s32) { // Test FoldChannels() on 32 bit samples. - int32 samples_s32[6] = { 12, 1, 3, 7, 13, 17 }; + int32 samples_s32[6] = { 1, 3, 12, 7, 13, 17 }; int32 expected_s32[2] = { static_cast<int16>(12 * .707 + 1), static_cast<int16>(12 * .707 + 3) }; bool result_s32 = media::FoldChannels(samples_s32, sizeof(samples_s32), |