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

Unified Diff: media/filters/ffmpeg_audio_decoder.cc

Issue 149573: Refactor WritableBuffer interface for more useful ptr management. (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') | media/filters/ffmpeg_video_decoder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_audio_decoder.cc
===================================================================
--- media/filters/ffmpeg_audio_decoder.cc (revision 20532)
+++ media/filters/ffmpeg_audio_decoder.cc (working copy)
@@ -107,9 +107,9 @@
// If we have decoded something, enqueue the result.
if (output_buffer_size) {
- DataBuffer* result_buffer = new DataBuffer();
- memcpy(result_buffer->GetWritableData(output_buffer_size),
- output_buffer, output_buffer_size);
+ DataBuffer* result_buffer = new DataBuffer(output_buffer_size);
+ uint8* data = result_buffer->GetWritableData();
+ memcpy(data, output_buffer, output_buffer_size);
// Determine the duration if the demuxer couldn't figure it out, otherwise
// copy it over.
@@ -131,7 +131,7 @@
// 2. FFmpeg didn't output anything.
// 3. An end of stream buffer is received.
if (result == 0 && output_buffer_size == 0 && input->IsEndOfStream()) {
- DataBuffer* result_buffer = new DataBuffer();
+ DataBuffer* result_buffer = new DataBuffer(0);
result_buffer->SetTimestamp(input->GetTimestamp());
result_buffer->SetDuration(input->GetDuration());
EnqueueResult(result_buffer);
« no previous file with comments | « media/filters/audio_renderer_algorithm_ola.cc ('k') | media/filters/ffmpeg_video_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698