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

Unified Diff: media/filters/audio_renderer_algorithm_default.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_default.h ('k') | media/filters/audio_renderer_algorithm_ola.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/audio_renderer_algorithm_default.cc
===================================================================
--- media/filters/audio_renderer_algorithm_default.cc (revision 20829)
+++ media/filters/audio_renderer_algorithm_default.cc (working copy)
@@ -5,7 +5,6 @@
#include "media/filters/audio_renderer_algorithm_default.h"
#include "media/base/buffers.h"
-#include "media/base/data_buffer.h"
namespace media {
@@ -15,7 +14,7 @@
AudioRendererAlgorithmDefault::~AudioRendererAlgorithmDefault() {
}
-size_t AudioRendererAlgorithmDefault::FillBuffer(DataBuffer* buffer_out) {
+size_t AudioRendererAlgorithmDefault::FillBuffer(uint8* dest, size_t length) {
if (playback_rate() == 0.0f) {
return 0;
}
@@ -23,20 +22,17 @@
size_t dest_written = 0;
if (playback_rate() == 1.0f) {
- size_t dest_length = buffer_out->GetDataSize();
- uint8* dest = buffer_out->GetWritableData();
-
// If we don't have enough data, copy what we have.
- if (QueueSize() < dest_length)
+ if (QueueSize() < length)
dest_written = CopyFromInput(dest, QueueSize());
else
- dest_written = CopyFromInput(dest, dest_length);
+ dest_written = CopyFromInput(dest, length);
AdvanceInputPosition(dest_written);
} else {
// Mute (we will write to the whole buffer, so set |dest_written| to the
// requested size).
- dest_written = buffer_out->GetDataSize();
- memset(buffer_out->GetWritableData(), 0, dest_written);
+ dest_written = length;
+ memset(dest, 0, dest_written);
// Calculate the number of bytes we "used".
size_t scaled_dest_length =
« no previous file with comments | « media/filters/audio_renderer_algorithm_default.h ('k') | media/filters/audio_renderer_algorithm_ola.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698