mirror of
https://github.com/stenzek/duckstation.git
synced 2025-06-06 19:45:33 +00:00
MediaCapture/FFmpeg: Log when dynlib open fails
This commit is contained in:
parent
e40bd20ea8
commit
ff2b3a11ef
@ -1956,18 +1956,25 @@ bool MediaCaptureFFmpeg::LoadFFmpeg(Error* error)
|
|||||||
if (s_library_loaded)
|
if (s_library_loaded)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
static constexpr auto open_dynlib = [](DynamicLibrary& lib, const char* name, int major_version, Error* error) {
|
static constexpr auto open_dynlib = [](DynamicLibrary& lib, const char* name, int major_version) {
|
||||||
std::string full_name(DynamicLibrary::GetVersionedFilename(name, major_version));
|
Error error;
|
||||||
return lib.Open(full_name.c_str(), error);
|
const std::string full_name = DynamicLibrary::GetVersionedFilename(name, major_version);
|
||||||
|
if (!lib.Open(full_name.c_str(), &error))
|
||||||
|
{
|
||||||
|
ERROR_LOG("Failed to open {}: {}", name, error.GetDescription());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool result = true;
|
bool result = true;
|
||||||
|
|
||||||
result = result && open_dynlib(s_avutil_library, "avutil", LIBAVUTIL_VERSION_MAJOR, error);
|
result = result && open_dynlib(s_avutil_library, "avutil", LIBAVUTIL_VERSION_MAJOR);
|
||||||
result = result && open_dynlib(s_avcodec_library, "avcodec", LIBAVCODEC_VERSION_MAJOR, error);
|
result = result && open_dynlib(s_avcodec_library, "avcodec", LIBAVCODEC_VERSION_MAJOR);
|
||||||
result = result && open_dynlib(s_avformat_library, "avformat", LIBAVFORMAT_VERSION_MAJOR, error);
|
result = result && open_dynlib(s_avformat_library, "avformat", LIBAVFORMAT_VERSION_MAJOR);
|
||||||
result = result && open_dynlib(s_swscale_library, "swscale", LIBSWSCALE_VERSION_MAJOR, error);
|
result = result && open_dynlib(s_swscale_library, "swscale", LIBSWSCALE_VERSION_MAJOR);
|
||||||
result = result && open_dynlib(s_swresample_library, "swresample", LIBSWRESAMPLE_VERSION_MAJOR, error);
|
result = result && open_dynlib(s_swresample_library, "swresample", LIBSWRESAMPLE_VERSION_MAJOR);
|
||||||
|
|
||||||
#define RESOLVE_IMPORT(X) result = result && s_avcodec_library.GetSymbol(#X, &wrap_##X);
|
#define RESOLVE_IMPORT(X) result = result && s_avcodec_library.GetSymbol(#X, &wrap_##X);
|
||||||
VISIT_AVCODEC_IMPORTS(RESOLVE_IMPORT);
|
VISIT_AVCODEC_IMPORTS(RESOLVE_IMPORT);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user