1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-15 15:49:36 +02:00

FFmpeg: Fall back to guessing avutil and avcodec filenames

When the avutil_version and avcodec_version symbols are not found, fall back to
guess the filenames of avutil and avcodec (as done in r13195 and previously).
This commit is contained in:
benjamin.drung@gmail.com 2014-06-18 22:24:17 +00:00
parent 9851b53a8f
commit b8a464709d
2 changed files with 36 additions and 0 deletions

View File

@ -791,6 +791,12 @@ bool FFmpegLibs::InitLibs(wxString libpath_format, bool WXUNUSED(showerr))
codec = avformat;
}
}
if (!avcodec_filename.FileExists()) {
avcodec_filename = GetLibAVCodecName();
}
if (!avutil_filename.FileExists()) {
avutil_filename = GetLibAVUtilName();
}
if (util == NULL || codec == NULL) {
wxLogMessage(wxT("avformat not monolithic"));

View File

@ -292,6 +292,16 @@ public:
{
return (wxT("avformat-") wxT(AV_STRINGIFY(LIBAVFORMAT_VERSION_MAJOR)) wxT(".dll"));
}
wxString GetLibAVCodecName()
{
return (wxT("avcodec-") wxT(AV_STRINGIFY(LIBAVCODEC_VERSION_MAJOR)) wxT(".dll"));
}
wxString GetLibAVUtilName()
{
return (wxT("avutil-") wxT(AV_STRINGIFY(LIBAVUTIL_VERSION_MAJOR)) wxT(".dll"));
}
#elif defined(__WXMAC__)
/* Library names and file filters for Mac OS only */
wxString GetLibraryTypeString()
@ -308,6 +318,16 @@ public:
{
return (wxT("libavformat.") wxT(AV_STRINGIFY(LIBAVFORMAT_VERSION_MAJOR)) wxT(".dylib"));
}
wxString GetLibAVCodecName()
{
return (wxT("libavcodec.") wxT(AV_STRINGIFY(LIBAVCODEC_VERSION_MAJOR)) wxT(".dylib"));
}
wxString GetLibAVUtilName()
{
return (wxT("libavutil.") wxT(AV_STRINGIFY(LIBAVUTIL_VERSION_MAJOR)) wxT(".dylib"));
}
#else
/* Library names and file filters for other platforms, basically Linux and
* other *nix platforms */
@ -325,6 +345,16 @@ public:
{
return (wxT("libavformat.so.") wxT(AV_STRINGIFY(LIBAVFORMAT_VERSION_MAJOR)));
}
wxString GetLibAVCodecName()
{
return (wxT("libavcodec.so.") wxT(AV_STRINGIFY(LIBAVCODEC_VERSION_MAJOR)));
}
wxString GetLibAVUtilName()
{
return (wxT("libavutil.so.") wxT(AV_STRINGIFY(LIBAVUTIL_VERSION_MAJOR)));
}
#endif // (__WXMAC__) || (__WXMSW__)
/// Ugly reference counting. I thought of using wxStuff for that,