1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "media/base/media.h"
8 #if defined(_WIN32_WINNT_WIN8)
9 // The Windows 8 SDK defines FACILITY_VISUALCPP in winerror.h.
10 #undef FACILITY_VISUALCPP
14 #include "base/files/file_path.h"
16 #pragma comment(lib, "delayimp.lib")
21 bool InitializeMediaLibraryInternal(const base::FilePath
& module_dir
) {
22 // LoadLibraryEx(..., LOAD_WITH_ALTERED_SEARCH_PATH) cannot handle
24 if (!module_dir
.IsAbsolute())
27 // Use alternate DLL search path so we don't load dependencies from the
28 // system path. Refer to http://crbug.com/35857
29 static const char kFFmpegDLL
[] = "ffmpegsumo.dll";
30 HMODULE lib
= ::LoadLibraryEx(
31 module_dir
.AppendASCII(kFFmpegDLL
).value().c_str(), NULL
,
32 LOAD_WITH_ALTERED_SEARCH_PATH
);
34 // Check that we loaded the library successfully.
38 } // namespace internal