summaryrefslogtreecommitdiffstats
path: root/media/base/audio_buffer.cc
diff options
context:
space:
mode:
authorjrummell@chromium.org <jrummell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-16 01:31:25 +0000
committerjrummell@chromium.org <jrummell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-16 01:31:25 +0000
commit67afc63ec87612be374e5486cc03f51c1fb18eb6 (patch)
tree310cd24c11bfe2cfc6abea6ad698755f91cd4927 /media/base/audio_buffer.cc
parent0275a5528dd5dde0db50f588e88bc2b200f60c21 (diff)
downloadchromium_src-67afc63ec87612be374e5486cc03f51c1fb18eb6.zip
chromium_src-67afc63ec87612be374e5486cc03f51c1fb18eb6.tar.gz
chromium_src-67afc63ec87612be374e5486cc03f51c1fb18eb6.tar.bz2
Fix to make sure FFmpeg and AudioBuffer use the same alignment.
Also adding a test to verify that FFmpeg and Chrome use the same sample size for all supported formats. BUG=272550 TEST=media_unittests all pass, played various audio files in the browser (mono, stereo, 5.1). Review URL: https://chromiumcodereview.appspot.com/22959004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@217907 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/audio_buffer.cc')
-rw-r--r--media/base/audio_buffer.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/media/base/audio_buffer.cc b/media/base/audio_buffer.cc
index b2cdd8c..0bf3720 100644
--- a/media/base/audio_buffer.cc
+++ b/media/base/audio_buffer.cc
@@ -11,11 +11,6 @@
namespace media {
-// Alignment of each channel's data; this must match what ffmpeg expects
-// (which may be 0, 16, or 32, depending on the processor). Selecting 32 in
-// order to work on all processors.
-enum { kChannelAlignment = 32 };
-
AudioBuffer::AudioBuffer(SampleFormat sample_format,
int channel_count,
int frame_count,
@@ -73,6 +68,8 @@ AudioBuffer::AudioBuffer(SampleFormat sample_format,
data_size *= channel_count;
data_.reset(
static_cast<uint8*>(base::AlignedAlloc(data_size, kChannelAlignment)));
+ channel_data_.reserve(1);
+ channel_data_.push_back(data_.get());
if (data)
memcpy(data_.get(), data[0], data_size);
}