summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--media/filters/ffmpeg_video_decode_engine.cc7
-rw-r--r--media/test/ffmpeg_tests/ffmpeg_tests.cc7
2 files changed, 13 insertions, 1 deletions
diff --git a/media/filters/ffmpeg_video_decode_engine.cc b/media/filters/ffmpeg_video_decode_engine.cc
index 916890b..568e322 100644
--- a/media/filters/ffmpeg_video_decode_engine.cc
+++ b/media/filters/ffmpeg_video_decode_engine.cc
@@ -48,8 +48,13 @@ void FFmpegVideoDecodeEngine::Initialize(AVStream* stream, Task* done_cb) {
codec_context_->error_recognition = FF_ER_CAREFUL;
AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
+
+ // TODO(fbarchard): On next ffmpeg roll, retest Theora multi-threading.
+ int decode_threads = (codec_context_->codec_id == CODEC_ID_THEORA)
+ ? 1 : kDecodeThreads;
+
if (codec &&
- avcodec_thread_init(codec_context_, kDecodeThreads) >= 0 &&
+ avcodec_thread_init(codec_context_, decode_threads) >= 0 &&
avcodec_open(codec_context_, codec) >= 0) {
state_ = kNormal;
} else {
diff --git a/media/test/ffmpeg_tests/ffmpeg_tests.cc b/media/test/ffmpeg_tests/ffmpeg_tests.cc
index 9dd7277..ff130d1 100644
--- a/media/test/ffmpeg_tests/ffmpeg_tests.cc
+++ b/media/test/ffmpeg_tests/ffmpeg_tests.cc
@@ -207,6 +207,13 @@ int main(int argc, const char** argv) {
return 1;
}
+ // TODO(fbarchard): On next ffmpeg roll, retest if this work around is needed.
+ if (codec_context->codec_id == CODEC_ID_THEORA) {
+ std::cerr << "Warning: Disabling threads to avoid Theora bug "
+ << in_path << std::endl;
+ video_threads = 1;
+ }
+
codec_context->flags2 |= CODEC_FLAG2_FAST;
// Initialize threaded decode.