summaryrefslogtreecommitdiffstats
path: root/media/audio
diff options
context:
space:
mode:
authorfbarchard@chromium.org <fbarchard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-17 18:12:25 +0000
committerfbarchard@chromium.org <fbarchard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-17 18:12:25 +0000
commit5c05b40cf995fe0bf0d60bcdb282f3d0d28ec1d9 (patch)
tree7721f62e5a16975a46a17f15272edd403310b2ae /media/audio
parent021052dbd3619f6ea8a248dab8f7bea35521048f (diff)
downloadchromium_src-5c05b40cf995fe0bf0d60bcdb282f3d0d28ec1d9.zip
chromium_src-5c05b40cf995fe0bf0d60bcdb282f3d0d28ec1d9.tar.gz
chromium_src-5c05b40cf995fe0bf0d60bcdb282f3d0d28ec1d9.tar.bz2
Fix folding code to respect new AAC channel order caused by ffmpeg roll. Also tested for OGG.
BUG=43094 TEST=play a movie with 5.1 sound. ie startrek-sbspot_h720p.mov. The voices should be centered. Review URL: http://codereview.chromium.org/2095007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47433 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/audio')
-rw-r--r--media/audio/audio_util.cc11
-rw-r--r--media/audio/audio_util_unittest.cc8
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),