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

Unified Diff: media/filters/ffmpeg_glue.cc

Issue 684763005: FFmpeg: Only use LazyInstance at global scope (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use g_ for global variable name Created 6 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_glue.cc
diff --git a/media/filters/ffmpeg_glue.cc b/media/filters/ffmpeg_glue.cc
index c74b0654e9983525dac71216df568ae0c1327c1e..20ebeafa9aa4af65be54fb461e8367d43d24e1b3 100644
--- a/media/filters/ffmpeg_glue.cc
+++ b/media/filters/ffmpeg_glue.cc
@@ -118,10 +118,11 @@ class FFmpegInitializer {
DISALLOW_COPY_AND_ASSIGN(FFmpegInitializer);
};
+static base::LazyInstance<FFmpegInitializer>::Leaky g_lazy_instance =
+ LAZY_INSTANCE_INITIALIZER;
void FFmpegGlue::InitializeFFmpeg() {
- static base::LazyInstance<FFmpegInitializer>::Leaky li =
- LAZY_INSTANCE_INITIALIZER;
- CHECK(li.Get().initialized());
+ // Get() will invoke the FFmpegInitializer constructor once.
+ CHECK(g_lazy_instance.Get().initialized());
}
FFmpegGlue::FFmpegGlue(FFmpegURLProtocol* protocol)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698