| Index: media/base/media_posix.cc
|
| diff --git a/media/base/media_posix.cc b/media/base/media_posix.cc
|
| index 01d9e5f14565672f65b8e0274a5c7627e224fe28..243495a4a1e9f5803528d6198a36a00a7c48ccea 100644
|
| --- a/media/base/media_posix.cc
|
| +++ b/media/base/media_posix.cc
|
| @@ -22,6 +22,7 @@ using third_party_ffmpeg::StubPathMap;
|
| #endif // !defined(USE_SYSTEM_FFMPEG)
|
|
|
| namespace media {
|
| +namespace internal {
|
|
|
| // Handy to prevent shooting ourselves in the foot with macro wizardry.
|
| #if !defined(LIBAVCODEC_VERSION_MAJOR) || \
|
| @@ -47,18 +48,11 @@ static const base::FilePath::CharType kSumoLib[] =
|
| #error "Do not know how to construct DSO name for this OS."
|
| #endif
|
|
|
| -// Use a global to indicate whether the library has been initialized or not. We
|
| -// rely on function level static initialization in InitializeMediaLibrary() to
|
| -// guarantee this is only set once in a thread safe manner.
|
| -static bool g_media_library_is_initialized = false;
|
| -
|
| -static bool InitializeMediaLibraryInternal(const base::FilePath& module_dir) {
|
| - DCHECK(!g_media_library_is_initialized);
|
| -
|
| +bool InitializeMediaLibraryInternal(const base::FilePath& module_dir) {
|
| #if defined(USE_SYSTEM_FFMPEG)
|
| // No initialization is necessary when using system ffmpeg,
|
| // we just link directly with system ffmpeg libraries.
|
| - g_media_library_is_initialized = true;
|
| + return true;
|
| #else
|
| StubPathMap paths;
|
|
|
| @@ -74,26 +68,9 @@ static bool InitializeMediaLibraryInternal(const base::FilePath& module_dir) {
|
| paths[kModuleFfmpegsumo].push_back(module_dir.Append(
|
| FILE_PATH_LITERAL(DSO_NAME("avformat", AVFORMAT_VERSION))).value());
|
|
|
| - g_media_library_is_initialized = InitializeStubs(paths);
|
| + return InitializeStubs(paths);
|
| #endif // !defined(USE_SYSTEM_FFMPEG)
|
| - return g_media_library_is_initialized;
|
| -}
|
| -
|
| -bool InitializeMediaLibrary(const base::FilePath& base_path) {
|
| - static const bool kMediaLibraryInitialized =
|
| - InitializeMediaLibraryInternal(base_path);
|
| - DCHECK_EQ(kMediaLibraryInitialized, g_media_library_is_initialized);
|
| - return kMediaLibraryInitialized;
|
| -}
|
| -
|
| -void InitializeMediaLibraryForTesting() {
|
| - base::FilePath file_path;
|
| - CHECK(PathService::Get(base::DIR_EXE, &file_path));
|
| - CHECK(InitializeMediaLibrary(file_path));
|
| -}
|
| -
|
| -bool IsMediaLibraryInitialized() {
|
| - return g_media_library_is_initialized;
|
| }
|
|
|
| +} // namespace internal
|
| } // namespace media
|
|
|