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

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: Get rid of spurious changes in previous patch-set. Created 9 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/base/media.h ('k') | media/base/media_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/media_posix.cc
diff --git a/media/base/media_posix.cc b/media/base/media_posix.cc
index 08684e773e097fdc3d0f81ef173334d55cf410bf..3621bd64dbef1ee245d72e779cd23bb00d3f8ace 100644
--- a/media/base/media_posix.cc
+++ b/media/base/media_posix.cc
@@ -66,9 +66,14 @@ static std::string GetDSOName(tp_ffmpeg::StubModules stub_key) {
}
}
+static bool g_media_library_is_initialized = false;
+
// Attempts to initialize the media library (loading DSOs, etc.).
// Returns true if everything was successfully initialized, false otherwise.
bool InitializeMediaLibrary(const FilePath& module_dir) {
+ if (g_media_library_is_initialized)
+ return true;
+
// TODO(ajwong): We need error resolution.
tp_ffmpeg::StubPathMap paths;
for (int i = 0; i < static_cast<int>(tp_ffmpeg::kNumStubModules); ++i) {
@@ -82,8 +87,12 @@ 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);
+ return g_media_library_is_initialized;
+}
+
+bool IsMediaLibraryInitialized() {
+ return g_media_library_is_initialized;
}
#if defined(OS_LINUX)
« no previous file with comments | « media/base/media.h ('k') | media/base/media_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698