mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-16 16:10:06 +02:00
For FFmpeg wxLog* messages:
Returned some of them to wxLogMessage from wxLogDebug. Made paths displayed consistently with '%s'. Changed some wordings for grammar and clarity. Var renames for clarity. Moved some declarations closer to their usage. Commented out the places where sys error logging was suppressed. There was no explanation why they were suppressed.
This commit is contained in:
parent
2ef7a3fd31
commit
d83682f262
152
src/FFmpeg.cpp
152
src/FFmpeg.cpp
@ -440,13 +440,13 @@ public:
|
|||||||
S.SetBorder(10);
|
S.SetBorder(10);
|
||||||
S.StartVerticalLay(true);
|
S.StartVerticalLay(true);
|
||||||
{
|
{
|
||||||
text.Printf(_("Audacity needs the file %s to import and export audio via FFmpeg."), mName.c_str());
|
text.Printf(_("Audacity needs the file '%s' to import and export audio via FFmpeg."), mName.c_str());
|
||||||
S.AddTitle(text);
|
S.AddTitle(text);
|
||||||
|
|
||||||
S.SetBorder(3);
|
S.SetBorder(3);
|
||||||
S.StartHorizontalLay(wxALIGN_LEFT, true);
|
S.StartHorizontalLay(wxALIGN_LEFT, true);
|
||||||
{
|
{
|
||||||
text.Printf(_("Location of %s:"), mName.c_str());
|
text.Printf(_("Location of '%s':"), mName.c_str());
|
||||||
S.AddTitle(text);
|
S.AddTitle(text);
|
||||||
}
|
}
|
||||||
S.EndHorizontalLay();
|
S.EndHorizontalLay();
|
||||||
@ -455,7 +455,7 @@ public:
|
|||||||
S.SetStretchyCol(0);
|
S.SetStretchyCol(0);
|
||||||
{
|
{
|
||||||
if (mLibPath.GetFullPath().IsEmpty()) {
|
if (mLibPath.GetFullPath().IsEmpty()) {
|
||||||
text.Printf(_("To find %s, click here -->"), mName.c_str());
|
text.Printf(_("To find '%s', click here -->"), mName.c_str());
|
||||||
mPathText = S.AddTextBox(wxT(""), text, 0);
|
mPathText = S.AddTextBox(wxT(""), text, 0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -484,8 +484,8 @@ public:
|
|||||||
wxString question;
|
wxString question;
|
||||||
/* i18n-hint: It's asking for the location of a file, for
|
/* i18n-hint: It's asking for the location of a file, for
|
||||||
example, "Where is lame_enc.dll?" - you could translate
|
example, "Where is lame_enc.dll?" - you could translate
|
||||||
"Where would I find the file %s" instead if you want. */
|
"Where would I find the file '%s'?" instead if you want. */
|
||||||
question.Printf(_("Where is %s?"), mName.c_str());
|
question.Printf(_("Where is '%s'?"), mName.c_str());
|
||||||
|
|
||||||
wxString path = FileSelector(question,
|
wxString path = FileSelector(question,
|
||||||
mLibPath.GetPath(),
|
mLibPath.GetPath(),
|
||||||
@ -564,9 +564,9 @@ bool FFmpegLibs::FindLibs(wxWindow *parent)
|
|||||||
wxString path;
|
wxString path;
|
||||||
wxString name;
|
wxString name;
|
||||||
|
|
||||||
wxLogDebug(wxT("Looking for FFmpeg libraries..."));
|
wxLogMessage(wxT("Looking for FFmpeg libraries..."));
|
||||||
if (!mLibAVFormatPath.IsEmpty()) {
|
if (!mLibAVFormatPath.IsEmpty()) {
|
||||||
wxLogDebug(wxT("mLibAVFormatPath is not empty, = %s"),mLibAVFormatPath.c_str());
|
wxLogDebug(wxT("mLibAVFormatPath ('%s') is not empty."), mLibAVFormatPath.c_str());
|
||||||
wxFileName fn = mLibAVFormatPath;
|
wxFileName fn = mLibAVFormatPath;
|
||||||
path = fn.GetPath();
|
path = fn.GetPath();
|
||||||
name = fn.GetFullName();
|
name = fn.GetFullName();
|
||||||
@ -574,7 +574,8 @@ bool FFmpegLibs::FindLibs(wxWindow *parent)
|
|||||||
else {
|
else {
|
||||||
path = GetLibAVFormatPath();
|
path = GetLibAVFormatPath();
|
||||||
name = GetLibAVFormatName();
|
name = GetLibAVFormatName();
|
||||||
wxLogDebug(wxT("mLibAVFormatPath is empty, starting with path '%s', name '%s'"),path.c_str(),name.c_str());
|
wxLogDebug(wxT("mLibAVFormatPath is empty, starting with path '%s', name '%s'."),
|
||||||
|
path.c_str(), name.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
FindFFmpegDialog fd(parent,
|
FindFFmpegDialog fd(parent,
|
||||||
@ -583,18 +584,18 @@ bool FFmpegLibs::FindLibs(wxWindow *parent)
|
|||||||
GetLibraryTypeString());
|
GetLibraryTypeString());
|
||||||
|
|
||||||
if (fd.ShowModal() == wxID_CANCEL) {
|
if (fd.ShowModal() == wxID_CANCEL) {
|
||||||
wxLogDebug(wxT("User canceled the dialog. Failed to find libraries."));
|
wxLogDebug(wxT("User canceled the dialog. Failed to find FFmpeg libraries."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
path = fd.GetLibPath();
|
path = fd.GetLibPath();
|
||||||
|
|
||||||
wxLogDebug(wxT("User-specified path = %s"),path.c_str());
|
wxLogMessage(wxT("User-specified path = '%s'"), path.c_str());
|
||||||
if (!::wxFileExists(path)) {
|
if (!::wxFileExists(path)) {
|
||||||
wxLogDebug(wxT("User-specified file doesn't exist! Failed to find libraries."));
|
wxLogError(wxT("User-specified file does not exist. Failed to find FFmpeg libraries."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
wxLogDebug(wxT("User-specified file exists. Success."));
|
wxLogMessage(wxT("User-specified FFmpeg file exists. Success."));
|
||||||
mLibAVFormatPath = path;
|
mLibAVFormatPath = path;
|
||||||
gPrefs->Write(wxT("/FFmpeg/FFmpegLibPath"), mLibAVFormatPath);
|
gPrefs->Write(wxT("/FFmpeg/FFmpegLibPath"), mLibAVFormatPath);
|
||||||
|
|
||||||
@ -604,15 +605,15 @@ bool FFmpegLibs::FindLibs(wxWindow *parent)
|
|||||||
bool FFmpegLibs::LoadLibs(wxWindow *parent, bool showerr)
|
bool FFmpegLibs::LoadLibs(wxWindow *parent, bool showerr)
|
||||||
{
|
{
|
||||||
|
|
||||||
wxLogDebug(wxT("Trying to load FFmpeg libraries"));
|
wxLogMessage(wxT("Trying to load FFmpeg libraries..."));
|
||||||
if (ValidLibsLoaded()) {
|
if (ValidLibsLoaded()) {
|
||||||
wxLogDebug(wxT("Libraries already loaded - freeing"));
|
wxLogMessage(wxT("FFmpeg libraries are already loaded."));
|
||||||
FreeLibs();
|
FreeLibs();
|
||||||
}
|
}
|
||||||
|
|
||||||
// First try loading it from a previously located path
|
// First try loading it from a previously located path
|
||||||
if (!mLibAVFormatPath.IsEmpty()) {
|
if (!mLibAVFormatPath.IsEmpty()) {
|
||||||
wxLogDebug(wxT("mLibAVFormatPath is not empty, = %s. Loading from it."),mLibAVFormatPath.c_str());
|
wxLogDebug(wxT("mLibAVFormatPath ('%s') is not empty. Loading from it."),mLibAVFormatPath.c_str());
|
||||||
mLibsLoaded = InitLibs(mLibAVFormatPath,showerr);
|
mLibsLoaded = InitLibs(mLibAVFormatPath,showerr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -620,7 +621,7 @@ bool FFmpegLibs::LoadLibs(wxWindow *parent, bool showerr)
|
|||||||
if (!mLibsLoaded && !GetLibAVFormatPath().IsEmpty()) {
|
if (!mLibsLoaded && !GetLibAVFormatPath().IsEmpty()) {
|
||||||
wxFileName fn(GetLibAVFormatPath(), GetLibAVFormatName());
|
wxFileName fn(GetLibAVFormatPath(), GetLibAVFormatName());
|
||||||
wxString path = fn.GetFullPath();
|
wxString path = fn.GetFullPath();
|
||||||
wxLogDebug(wxT("Trying to load from default path %s."),path.c_str());
|
wxLogMessage(wxT("Trying to load FFmpeg libraries from default path, '%s'."), path.c_str());
|
||||||
mLibsLoaded = InitLibs(path,showerr);
|
mLibsLoaded = InitLibs(path,showerr);
|
||||||
if (mLibsLoaded) {
|
if (mLibsLoaded) {
|
||||||
mLibAVFormatPath = path;
|
mLibAVFormatPath = path;
|
||||||
@ -630,7 +631,7 @@ bool FFmpegLibs::LoadLibs(wxWindow *parent, bool showerr)
|
|||||||
// If not successful, try loading using system search paths
|
// If not successful, try loading using system search paths
|
||||||
if (!ValidLibsLoaded()) {
|
if (!ValidLibsLoaded()) {
|
||||||
wxString path = GetLibAVFormatName();
|
wxString path = GetLibAVFormatName();
|
||||||
wxLogDebug(wxT("Trying to load from system paths. File name is %s"),path.c_str());
|
wxLogDebug(wxT("Trying to load FFmpeg libraries from system paths. File name is '%s'."), path.c_str());
|
||||||
mLibsLoaded = InitLibs(path,showerr);
|
mLibsLoaded = InitLibs(path,showerr);
|
||||||
if (mLibsLoaded) {
|
if (mLibsLoaded) {
|
||||||
mLibAVFormatPath = path;
|
mLibAVFormatPath = path;
|
||||||
@ -655,11 +656,14 @@ bool FFmpegLibs::LoadLibs(wxWindow *parent, bool showerr)
|
|||||||
*/
|
*/
|
||||||
// Oh well, just give up
|
// Oh well, just give up
|
||||||
if (!ValidLibsLoaded()) {
|
if (!ValidLibsLoaded()) {
|
||||||
if (showerr) wxMessageBox(_("Failed to find compatible FFmpeg libraries"));
|
wxString msg = _("Failed to find compatible FFmpeg libraries.");
|
||||||
|
if (showerr)
|
||||||
|
wxMessageBox(msg);
|
||||||
|
wxLogError(msg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxLogDebug(wxT("Libraries loaded successfully!"));
|
wxLogMessage(wxT("FFmpeg libraries loaded successfully."));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -670,74 +674,69 @@ bool FFmpegLibs::ValidLibsLoaded()
|
|||||||
|
|
||||||
bool FFmpegLibs::InitLibs(wxString libpath_format, bool showerr)
|
bool FFmpegLibs::InitLibs(wxString libpath_format, bool showerr)
|
||||||
{
|
{
|
||||||
// Initially we don't know where are the avcodec and avutl libs
|
|
||||||
wxDynamicLibrary *codec = NULL;
|
|
||||||
wxDynamicLibrary *util = NULL;
|
|
||||||
wxFileName name(libpath_format);
|
|
||||||
|
|
||||||
wxLogWindow* mLogger = wxGetApp().mLogger;
|
|
||||||
|
|
||||||
bool gotError = false;
|
|
||||||
|
|
||||||
wxString syspath;
|
wxString syspath;
|
||||||
bool pathfix = false;
|
bool pathfix = false;
|
||||||
|
|
||||||
FreeLibs();
|
FreeLibs();
|
||||||
|
|
||||||
#if defined(__WXMSW__)
|
#if defined(__WXMSW__)
|
||||||
wxLogDebug(wxT("Looking up PATH..."));
|
wxLogMessage(wxT("Looking up PATH environment variable..."));
|
||||||
// First take PATH environment variable (store it's content)
|
// First take PATH environment variable and store its content.
|
||||||
if (wxGetEnv(wxT("PATH"),&syspath))
|
if (wxGetEnv(wxT("PATH"),&syspath))
|
||||||
{
|
{
|
||||||
wxLogDebug(wxT("PATH = %s"),syspath.c_str());
|
wxLogMessage(wxT("PATH = '%s'"), syspath.c_str());
|
||||||
wxString fmtdirsc = wxPathOnly(libpath_format) + wxT(";");
|
wxString fmtdirsc = wxPathOnly(libpath_format) + wxT(";");
|
||||||
wxString scfmtdir = wxT(";") + wxPathOnly(libpath_format);
|
wxString scfmtdir = wxT(";") + wxPathOnly(libpath_format);
|
||||||
wxString fmtdir = wxPathOnly(libpath_format);
|
wxString fmtdir = wxPathOnly(libpath_format);
|
||||||
wxLogDebug(wxT("Checking that %s is in PATH..."),fmtdir.c_str());
|
wxLogMessage(wxT("Checking that '%s' is in PATH..."), fmtdir.c_str());
|
||||||
// If the directory, where libavformat is, is not in PATH - add it
|
// If the directory, where libavformat is, is not in PATH - add it
|
||||||
if (!syspath.Contains(fmtdirsc) && !syspath.Contains(scfmtdir) && !syspath.Contains(fmtdir))
|
if (!syspath.Contains(fmtdirsc) && !syspath.Contains(scfmtdir) && !syspath.Contains(fmtdir))
|
||||||
{
|
{
|
||||||
wxLogDebug(wxT("not in PATH!"));
|
wxLogWarning(wxT("FFmpeg directory is not in PATH."), fmtdir.c_str());
|
||||||
if (syspath.Last() == wxT(';'))
|
if (syspath.Last() == wxT(';'))
|
||||||
{
|
{
|
||||||
wxLogDebug(wxT("Appending %s ..."),fmtdir.c_str());
|
wxLogMessage(wxT("Temporarily appending '%s' to PATH..."), fmtdir.c_str());
|
||||||
syspath.Append(fmtdirsc);
|
syspath.Append(fmtdirsc);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wxLogDebug(wxT("Appending %s ..."),scfmtdir.c_str());
|
wxLogMessage(wxT("Temporarily appending '%s' to PATH..."), scfmtdir.c_str());
|
||||||
syspath.Append(scfmtdir);
|
syspath.Append(scfmtdir);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wxSetEnv(wxT("PATH"),syspath.c_str()))
|
if (wxSetEnv(wxT("PATH"),syspath.c_str()))
|
||||||
{
|
|
||||||
// Remember to change PATH back to normal after we're done
|
// Remember to change PATH back to normal after we're done
|
||||||
pathfix = true;
|
pathfix = true;
|
||||||
|
else
|
||||||
|
wxLogSysError(wxT("Setting PATH via wxSetEnv('%s') failed."),syspath.c_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wxLogDebug(wxT("wxSetEnv(%s) failed."),syspath.c_str());
|
wxLogMessage(wxT("FFmpeg directory is in PATH."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wxLogDebug(wxT("in PATH."));
|
wxLogSysError(wxT("PATH does not exist."));
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
wxLogDebug(wxT("PATH does not exist."));
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Load libavformat
|
//Load libavformat
|
||||||
|
// Initially we don't know where are the avcodec and avutl libs
|
||||||
|
wxDynamicLibrary *codec = NULL;
|
||||||
|
wxDynamicLibrary *util = NULL;
|
||||||
|
wxFileName name(libpath_format);
|
||||||
|
bool gotError = false;
|
||||||
|
|
||||||
avformat = new wxDynamicLibrary();
|
avformat = new wxDynamicLibrary();
|
||||||
wxLogDebug(wxT("Loading avformat from %s"),libpath_format.c_str());
|
wxLogDebug(wxT("Loading avformat from '%s'."), libpath_format.c_str());
|
||||||
if (showerr)
|
// Vaughan, 2010-08-17: No explanation why logging was turned off, so commented these out.
|
||||||
mLogger->SetActiveTarget(NULL);
|
//wxLogWindow* pLogger = wxGetApp().mLogger;
|
||||||
|
//if (showerr)
|
||||||
|
// pLogger->SetActiveTarget(NULL);
|
||||||
gotError = !avformat->Load(libpath_format, wxDL_LAZY);
|
gotError = !avformat->Load(libpath_format, wxDL_LAZY);
|
||||||
if (showerr)
|
//if (showerr)
|
||||||
mLogger->SetActiveTarget(mLogger);
|
// pLogger->SetActiveTarget(pLogger);
|
||||||
|
|
||||||
if (!gotError) {
|
if (!gotError) {
|
||||||
if (avformat->HasSymbol(wxT("av_free"))) {
|
if (avformat->HasSymbol(wxT("av_free"))) {
|
||||||
@ -751,43 +750,43 @@ bool FFmpegLibs::InitLibs(wxString libpath_format, bool showerr)
|
|||||||
if (!util) {
|
if (!util) {
|
||||||
name.SetFullName(GetLibAVUtilName());
|
name.SetFullName(GetLibAVUtilName());
|
||||||
avutil = util = new wxDynamicLibrary();
|
avutil = util = new wxDynamicLibrary();
|
||||||
wxLogDebug(wxT("Loading avutil from %s"),name.GetFullPath().c_str());
|
wxLogDebug(wxT("Loading avutil from '%s'."), name.GetFullPath().c_str());
|
||||||
if (showerr)
|
//if (showerr)
|
||||||
mLogger->SetActiveTarget(NULL);
|
// pLogger->SetActiveTarget(NULL);
|
||||||
util->Load(name.GetFullPath(), wxDL_LAZY);
|
util->Load(name.GetFullPath(), wxDL_LAZY);
|
||||||
if (showerr)
|
//if (showerr)
|
||||||
mLogger->SetActiveTarget(mLogger);
|
// pLogger->SetActiveTarget(pLogger);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!codec) {
|
if (!codec) {
|
||||||
name.SetFullName(GetLibAVCodecName());
|
name.SetFullName(GetLibAVCodecName());
|
||||||
avcodec = codec = new wxDynamicLibrary();
|
avcodec = codec = new wxDynamicLibrary();
|
||||||
wxLogDebug(wxT("Loading avcodec from %s"),name.GetFullPath().c_str());
|
wxLogDebug(wxT("Loading avcodec from '%s'."), name.GetFullPath().c_str());
|
||||||
if (showerr)
|
//if (showerr)
|
||||||
mLogger->SetActiveTarget(NULL);
|
// pLogger->SetActiveTarget(NULL);
|
||||||
codec->Load(name.GetFullPath(), wxDL_LAZY);
|
codec->Load(name.GetFullPath(), wxDL_LAZY);
|
||||||
if (showerr)
|
//if (showerr)
|
||||||
mLogger->SetActiveTarget(mLogger);
|
// pLogger->SetActiveTarget(pLogger);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!avformat->IsLoaded()) {
|
if (!avformat->IsLoaded()) {
|
||||||
if (showerr)
|
//if (showerr)
|
||||||
mLogger->SetActiveTarget(NULL);
|
// pLogger->SetActiveTarget(NULL);
|
||||||
gotError = !avformat->Load(libpath_format, wxDL_LAZY);
|
gotError = !avformat->Load(libpath_format, wxDL_LAZY);
|
||||||
if (showerr)
|
//if (showerr)
|
||||||
mLogger->SetActiveTarget(mLogger);
|
// pLogger->SetActiveTarget(pLogger);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Return PATH to normal
|
//Return PATH to normal
|
||||||
if ( pathfix )
|
if ( pathfix )
|
||||||
{
|
{
|
||||||
wxString oldpath = syspath.BeforeLast(wxT(';'));
|
wxString oldpath = syspath.BeforeLast(wxT(';'));
|
||||||
wxLogDebug(wxT("Returning PATH to normal..."));
|
wxLogMessage(wxT("Returning PATH to previous setting..."));
|
||||||
wxSetEnv(wxT("PATH"),oldpath.c_str());
|
wxSetEnv(wxT("PATH"),oldpath.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gotError) {
|
if (gotError) {
|
||||||
wxLogError(wxT("Failed to load FFmpeg libs"));
|
wxLogError(wxT("Failed to load FFmpeg libraries."));
|
||||||
FreeLibs();
|
FreeLibs();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -887,7 +886,7 @@ bool FFmpegLibs::InitLibs(wxString libpath_format, bool showerr)
|
|||||||
this->avcodec_register_all();
|
this->avcodec_register_all();
|
||||||
this->av_register_all();
|
this->av_register_all();
|
||||||
|
|
||||||
wxLogDebug(wxT("Retrieving library version."));
|
wxLogMessage(wxT("Retrieving FFmpeg library version numbers:"));
|
||||||
int avcver = this->avcodec_version();
|
int avcver = this->avcodec_version();
|
||||||
int avfver = this->avformat_version();
|
int avfver = this->avformat_version();
|
||||||
int avuver = this->avutil_version();
|
int avuver = this->avutil_version();
|
||||||
@ -895,20 +894,29 @@ bool FFmpegLibs::InitLibs(wxString libpath_format, bool showerr)
|
|||||||
mAVFormatVersion = wxString::Format(wxT("%d.%d.%d"),avfver >> 16 & 0xFF, avfver >> 8 & 0xFF, avfver & 0xFF);
|
mAVFormatVersion = wxString::Format(wxT("%d.%d.%d"),avfver >> 16 & 0xFF, avfver >> 8 & 0xFF, avfver & 0xFF);
|
||||||
mAVUtilVersion = wxString::Format(wxT("%d.%d.%d"),avuver >> 16 & 0xFF, avuver >> 8 & 0xFF, avuver & 0xFF);
|
mAVUtilVersion = wxString::Format(wxT("%d.%d.%d"),avuver >> 16 & 0xFF, avuver >> 8 & 0xFF, avuver & 0xFF);
|
||||||
|
|
||||||
wxLogDebug(wxT("AVCodec version 0x%06x - %s (built against 0x%06x - %s)"),avcver,mAVCodecVersion.c_str(),LIBAVCODEC_VERSION_INT,wxString::FromUTF8(AV_STRINGIFY(LIBAVCODEC_VERSION)).c_str());
|
wxLogMessage(wxT(" AVCodec version 0x%06x - %s (built against 0x%06x - %s)"),
|
||||||
wxLogDebug(wxT("AVFormat version 0x%06x - %s (built against 0x%06x - %s)"),avfver,mAVFormatVersion.c_str(),LIBAVFORMAT_VERSION_INT,wxString::FromUTF8(AV_STRINGIFY(LIBAVFORMAT_VERSION)).c_str());
|
avcver, mAVCodecVersion.c_str(), LIBAVCODEC_VERSION_INT,
|
||||||
wxLogDebug(wxT("AVUtil version 0x%06x - %s (built against 0x%06x - %s)"),avuver,mAVUtilVersion.c_str(),LIBAVUTIL_VERSION_INT,wxString::FromUTF8(AV_STRINGIFY(LIBAVUTIL_VERSION)).c_str());
|
wxString::FromUTF8(AV_STRINGIFY(LIBAVCODEC_VERSION)).c_str());
|
||||||
|
wxLogMessage(wxT(" AVFormat version 0x%06x - %s (built against 0x%06x - %s)"),
|
||||||
|
avfver, mAVFormatVersion.c_str(), LIBAVFORMAT_VERSION_INT,
|
||||||
|
wxString::FromUTF8(AV_STRINGIFY(LIBAVFORMAT_VERSION)).c_str());
|
||||||
|
wxLogMessage(wxT(" AVUtil version 0x%06x - %s (built against 0x%06x - %s)"),
|
||||||
|
avuver,mAVUtilVersion.c_str(), LIBAVUTIL_VERSION_INT,
|
||||||
|
wxString::FromUTF8(AV_STRINGIFY(LIBAVUTIL_VERSION)).c_str());
|
||||||
|
|
||||||
int avcverdiff = (avcver >> 16 & 0xFF) - int(LIBAVCODEC_VERSION_MAJOR);
|
int avcverdiff = (avcver >> 16 & 0xFF) - int(LIBAVCODEC_VERSION_MAJOR);
|
||||||
int avfverdiff = (avfver >> 16 & 0xFF) - int(LIBAVFORMAT_VERSION_MAJOR);
|
int avfverdiff = (avfver >> 16 & 0xFF) - int(LIBAVFORMAT_VERSION_MAJOR);
|
||||||
int avuverdiff = (avuver >> 16 & 0xFF) - int(LIBAVUTIL_VERSION_MAJOR);
|
int avuverdiff = (avuver >> 16 & 0xFF) - int(LIBAVUTIL_VERSION_MAJOR);
|
||||||
wxLogDebug(wxT("AVCodec version mismatch is %d"),avcverdiff);
|
if (avcverdiff != 0)
|
||||||
wxLogDebug(wxT("AVFormat version mismatch is %d"),avfverdiff);
|
wxLogError(wxT("AVCodec version mismatch = %d"), avcverdiff);
|
||||||
wxLogDebug(wxT("AVUtil version mismatch is %d"),avuverdiff);
|
if (avfverdiff != 0)
|
||||||
|
wxLogError(wxT("AVFormat version mismatch = %d"), avfverdiff);
|
||||||
|
if (avuverdiff != 0)
|
||||||
|
wxLogError(wxT("AVUtil version mismatch = %d"), avuverdiff);
|
||||||
//make sure that header and library major versions are the same
|
//make sure that header and library major versions are the same
|
||||||
if (avcverdiff != 0 || avfverdiff != 0 || avuverdiff != 0)
|
if (avcverdiff != 0 || avfverdiff != 0 || avuverdiff != 0)
|
||||||
{
|
{
|
||||||
wxLogError(wxT("Version mismatch! Libraries are unusable."));
|
wxLogError(wxT("Version mismatch. FFmpeg libraries are unusable."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user