Index: media/base/decoder_buffer.cc |
diff --git a/media/base/decoder_buffer.cc b/media/base/decoder_buffer.cc |
index 527fb65ec945c550fc673aca5501aed16ec79fe3..3c298a4ff062809a5af26b5ffd8ba27bf9c03208 100644 |
--- a/media/base/decoder_buffer.cc |
+++ b/media/base/decoder_buffer.cc |
@@ -6,8 +6,9 @@ |
#include "base/logging.h" |
#include "media/base/decrypt_config.h" |
+ |
#if !defined(OS_ANDROID) |
-#include "media/ffmpeg/ffmpeg_common.h" |
+#include "base/memory/aligned_memory.h" |
#endif |
namespace media { |
@@ -34,7 +35,7 @@ DecoderBuffer::DecoderBuffer(const uint8* data, int buffer_size) |
DecoderBuffer::~DecoderBuffer() { |
#if !defined(OS_ANDROID) |
- av_free(data_); |
+ base::AlignedFree(data_); |
#else |
delete[] data_; |
#endif |
@@ -43,12 +44,9 @@ DecoderBuffer::~DecoderBuffer() { |
void DecoderBuffer::Initialize() { |
DCHECK_GE(buffer_size_, 0); |
#if !defined(OS_ANDROID) |
- // Why FF_INPUT_BUFFER_PADDING_SIZE? FFmpeg assumes all input buffers are |
- // padded. Using av_malloc with padding ensures FFmpeg only recieves data |
- // padded and aligned to its specifications. |
data_ = reinterpret_cast<uint8*>( |
- av_malloc(buffer_size_ + FF_INPUT_BUFFER_PADDING_SIZE)); |
- memset(data_ + buffer_size_, 0, FF_INPUT_BUFFER_PADDING_SIZE); |
+ base::AlignedAlloc(buffer_size_ + kPaddingSize, kAlignmentSize)); |
+ memset(data_ + buffer_size_, 0, kPaddingSize); |
#else |
data_ = new uint8[buffer_size_]; |
#endif |