summaryrefslogtreecommitdiffstats
path: root/media/webm/webm_cluster_parser.cc
diff options
context:
space:
mode:
authoracolwell@chromium.org <acolwell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-31 04:48:33 +0000
committeracolwell@chromium.org <acolwell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-31 04:48:33 +0000
commitb7f5fe96df69326e1d142daf179a34e820bfeafe (patch)
treec9e3985c80a0140ce5109b4a65cc6d5c5428cd8f /media/webm/webm_cluster_parser.cc
parent9d5e4555afb9a326696abad72ed64c15907b46a7 (diff)
downloadchromium_src-b7f5fe96df69326e1d142daf179a34e820bfeafe.zip
chromium_src-b7f5fe96df69326e1d142daf179a34e820bfeafe.tar.gz
chromium_src-b7f5fe96df69326e1d142daf179a34e820bfeafe.tar.bz2
Fix ChunkDemuxer seek deadlock
BUG=109879 TEST=PipelineIntegrationTest.ChunkDemuxerAbortRead_*,FFmpegAudioDecoderTest.AbortRead, AudioRendererBaseTest.AbortPendingRead_* Review URL: https://chromiumcodereview.appspot.com/9295020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119851 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/webm/webm_cluster_parser.cc')
-rw-r--r--media/webm/webm_cluster_parser.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/media/webm/webm_cluster_parser.cc b/media/webm/webm_cluster_parser.cc
index 8151ec6..92f1dc7 100644
--- a/media/webm/webm_cluster_parser.cc
+++ b/media/webm/webm_cluster_parser.cc
@@ -6,13 +6,17 @@
#include "base/logging.h"
#include "media/base/data_buffer.h"
+#include "media/ffmpeg/ffmpeg_common.h"
#include "media/webm/webm_constants.h"
namespace media {
static Buffer* CreateBuffer(const uint8* data, size_t size) {
- scoped_array<uint8> buf(new uint8[size]);
+ // Why FF_INPUT_BUFFER_PADDING_SIZE? FFmpeg assumes all input buffers are
+ // padded with this value.
+ scoped_array<uint8> buf(new uint8[size + FF_INPUT_BUFFER_PADDING_SIZE]);
memcpy(buf.get(), data, size);
+ memset(buf.get() + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
return new DataBuffer(buf.Pass(), size);
}
@@ -129,7 +133,7 @@ bool WebMClusterParser::OnSimpleBlock(int track_num, int timecode,
if (!queue->empty() &&
buffer->GetTimestamp() == queue->back()->GetTimestamp()) {
DVLOG(1) << "Got SimpleBlock timecode is not strictly monotonically "
- << "increasing for track " << track_num;
+ << "increasing for track " << track_num;
return false;
}