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

Unified Diff: media/tools/wav_ola_test.cc

Issue 155615: Modify ARAB to use simpler data types in FillBuffer() calls. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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
« no previous file with comments | « media/filters/audio_renderer_algorithm_ola.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/tools/wav_ola_test.cc
===================================================================
--- media/tools/wav_ola_test.cc (revision 20829)
+++ media/tools/wav_ola_test.cc (working copy)
@@ -50,6 +50,7 @@
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 @@
}
// 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;
« no previous file with comments | « media/filters/audio_renderer_algorithm_ola.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698