Index: media/base/decoder_buffer.cc |
diff --git a/media/base/decoder_buffer.cc b/media/base/decoder_buffer.cc |
index 527fb65ec945c550fc673aca5501aed16ec79fe3..9e9cf04ba4fff467f20e4220bac9102dcacd5296 100644 |
--- a/media/base/decoder_buffer.cc |
+++ b/media/base/decoder_buffer.cc |
@@ -5,10 +5,10 @@ |
#include "media/base/decoder_buffer.h" |
#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 |
+#include "media/base/decrypt_config.h" |
namespace media { |
@@ -34,7 +34,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 +43,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 |