diff options
author | kylep@chromium.org <kylep@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-16 20:27:59 +0000 |
---|---|---|
committer | kylep@chromium.org <kylep@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-16 20:27:59 +0000 |
commit | 621124d547543b997e7c4adaa38d851a168e68c0 (patch) | |
tree | f6a2ff0c8d2c5fd801b0f571f97aec2d70215ef2 /media/tools | |
parent | 6fb25f8f070434d09783c154eca477ed80e708d4 (diff) | |
download | chromium_src-621124d547543b997e7c4adaa38d851a168e68c0.zip chromium_src-621124d547543b997e7c4adaa38d851a168e68c0.tar.gz chromium_src-621124d547543b997e7c4adaa38d851a168e68c0.tar.bz2 |
Modify ARAB to use simpler data types in FillBuffer() calls.
BUG=16011
TEST=none
Review URL: http://codereview.chromium.org/155615
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20892 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/tools')
-rw-r--r-- | media/tools/wav_ola_test.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/media/tools/wav_ola_test.cc b/media/tools/wav_ola_test.cc index 64a8672..c578cd5 100644 --- a/media/tools/wav_ola_test.cc +++ b/media/tools/wav_ola_test.cc @@ -50,6 +50,7 @@ class Dummy { void ReadDataForAlg() { scoped_refptr<DataBuffer> buffer(new DataBuffer(window_size_)); + buffer->SetDataSize(window_size_); uint8* buf = buffer->GetWritableData(); if (fread(buf, 1, window_size_, input_) > 0) { ola_->EnqueueBuffer(buffer.get()); @@ -136,14 +137,15 @@ int main(int argc, const char** argv) { } // Create buffer to be filled by |ola|. - scoped_refptr<DataBuffer> buffer(new DataBuffer(window_size)); - const uint8* buf = buffer->GetData(); + scoped_array<uint8> buf(new uint8[window_size]); + + CHECK(buf.get()); // Keep track of bytes written to disk and bytes copied to |b|. size_t bytes_written = 0; size_t bytes; - while ((bytes = ola.FillBuffer(buffer.get())) > 0) { - if (fwrite(buf, 1, bytes, output.get()) != bytes) { + while ((bytes = ola.FillBuffer(buf.get(), window_size)) > 0) { + if (fwrite(buf.get(), 1, bytes, output.get()) != bytes) { LOG(ERROR) << "could not write data after " << bytes_written; } else { bytes_written += bytes; |