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

Unified Diff: media/filters/ffmpeg_video_decode_engine.cc

Issue 854006: Revert 41386 - Removed custom FFmpegLock. Removed ffmpeg headers from third_p... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 9 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/ffmpeg_glue.cc ('k') | third_party/ffmpeg/avcodec-52.sigs » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_video_decode_engine.cc
===================================================================
--- media/filters/ffmpeg_video_decode_engine.cc (revision 41387)
+++ media/filters/ffmpeg_video_decode_engine.cc (working copy)
@@ -47,13 +47,17 @@
codec_context_->error_concealment = FF_EC_GUESS_MVS | FF_EC_DEBLOCK;
codec_context_->error_recognition = FF_ER_CAREFUL;
+ // Serialize calls to avcodec_open().
AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
- if (codec &&
- avcodec_thread_init(codec_context_, kDecodeThreads) >= 0 &&
- avcodec_open(codec_context_, codec) >= 0) {
- state_ = kNormal;
- } else {
- state_ = kError;
+ {
+ AutoLock auto_lock(FFmpegLock::get()->lock());
+ if (codec &&
+ avcodec_thread_init(codec_context_, kDecodeThreads) >= 0 &&
+ avcodec_open(codec_context_, codec) >= 0) {
+ state_ = kNormal;
+ } else {
+ state_ = kError;
+ }
}
}
« no previous file with comments | « media/filters/ffmpeg_glue.cc ('k') | third_party/ffmpeg/avcodec-52.sigs » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698