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

Unified Diff: media/filters/ffmpeg_demuxer.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_audio_decoder.cc ('k') | media/filters/ffmpeg_glue.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_demuxer.cc
===================================================================
--- media/filters/ffmpeg_demuxer.cc (revision 41387)
+++ media/filters/ffmpeg_demuxer.cc (working copy)
@@ -235,6 +235,7 @@
// in the decoder filters. By reaching this point, all filters should have
// stopped, so this is the only safe place to do the global clean up.
// TODO(hclam): close the codecs in the corresponding decoders.
+ AutoLock auto_lock(FFmpegLock::get()->lock());
if (!format_context_)
return;
@@ -396,12 +397,17 @@
DCHECK(context);
format_context_ = context;
- // Fully initialize AVFormatContext by parsing the stream a little.
- result = av_find_stream_info(format_context_);
- if (result < 0) {
- host()->SetError(DEMUXER_ERROR_COULD_NOT_PARSE);
- callback->Run();
- return;
+ // Serialize calls to av_find_stream_info().
+ {
+ AutoLock auto_lock(FFmpegLock::get()->lock());
+
+ // Fully initialize AVFormatContext by parsing the stream a little.
+ result = av_find_stream_info(format_context_);
+ if (result < 0) {
+ host()->SetError(DEMUXER_ERROR_COULD_NOT_PARSE);
+ callback->Run();
+ return;
+ }
}
// Create demuxer streams for all supported streams.
« no previous file with comments | « media/filters/ffmpeg_audio_decoder.cc ('k') | media/filters/ffmpeg_glue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698