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

Unified Diff: media/base/media_posix.cc

Issue 6537022: Move media library path resolution into Chrome path provider. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: And again, this time with working tests... Created 9 years, 10 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
Index: media/base/media_posix.cc
diff --git a/media/base/media_posix.cc b/media/base/media_posix.cc
index 438155a250abd0cc2154a5caa6b9fc87441e3591..fe14caf0328d2a4a6a3de4ca12874b0084ffafc0 100644
--- a/media/base/media_posix.cc
+++ b/media/base/media_posix.cc
@@ -66,11 +66,16 @@ std::string GetDSOName(tp_ffmpeg::StubModules stub_key) {
}
}
+static bool g_media_library_is_initialized = false;
awong 2011/02/25 02:41:59 If it's in an anonymous namespace, don't bother wi
+
} // namespace
// Attempts to initialize the media library (loading DSOs, etc.).
// Returns true if everything was successfully initialized, false otherwise.
-bool InitializeMediaLibrary(const FilePath& module_dir) {
+void InitializeMediaLibrary(const FilePath& module_dir) {
+ if (g_media_library_is_initialized)
+ return;
+
// TODO(ajwong): We need error resolution.
tp_ffmpeg::StubPathMap paths;
for (int i = 0; i < static_cast<int>(tp_ffmpeg::kNumStubModules); ++i) {
@@ -84,8 +89,11 @@ bool InitializeMediaLibrary(const FilePath& module_dir) {
paths[module].push_back(path.value());
}
- bool ret = tp_ffmpeg::InitializeStubs(paths);
- return ret;
+ g_media_library_is_initialized = tp_ffmpeg::InitializeStubs(paths);
+}
+
+bool IsMediaLibraryInitialized() {
+ return g_media_library_is_initialized;
}
#if defined(OS_LINUX)

Powered by Google App Engine
This is Rietveld 408576698