From 47135b696a2a9825f45738afbf0d0dcf9e4b761c Mon Sep 17 00:00:00 2001 From: LoRd_MuldeR Date: Thu, 10 May 2018 17:59:15 +0200 Subject: [PATCH] Do *not* try to check the MediaInfo in XML output, if we are using an "external" MediaInfo binary. In that case the expected MediaInfo version is UINT_MAX and the check would always fail. --- src/Config.h | 2 +- src/Thread_FileAnalyzer_Task.cpp | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/Config.h b/src/Config.h index 447b69e1..7df88bb1 100644 --- a/src/Config.h +++ b/src/Config.h @@ -35,7 +35,7 @@ #define VER_LAMEXP_MINOR_LO 6 #define VER_LAMEXP_TYPE Final #define VER_LAMEXP_PATCH 1 -#define VER_LAMEXP_BUILD 2134 +#define VER_LAMEXP_BUILD 2137 #define VER_LAMEXP_CONFG 2134 /////////////////////////////////////////////////////////////////////////////// diff --git a/src/Thread_FileAnalyzer_Task.cpp b/src/Thread_FileAnalyzer_Task.cpp index c5abd269..adb68b84 100644 --- a/src/Thread_FileAnalyzer_Task.cpp +++ b/src/Thread_FileAnalyzer_Task.cpp @@ -377,10 +377,21 @@ const AudioFileModel& AnalyzeTask::parseMediaInfo(const QByteArray &data, AudioF qWarning("Invalid library identiofier property: \"%s\"", MUTILS_UTF8(identifier)); return audioFile; } - const quint32 mediaInfoVer = (m_mediaInfoVer > 9999U) ? m_mediaInfoVer / 10U : m_mediaInfoVer; - if (versionLib.isEmpty() || (!checkVersionStr(versionLib, mediaInfoVer / 100U, mediaInfoVer % 100U))) + if (!versionLib.isEmpty()) { - qWarning("Invalid library version property: \"%s\"", MUTILS_UTF8(versionLib)); + if (m_mediaInfoVer != UINT_MAX) + { + const quint32 mediaInfoVer = (m_mediaInfoVer > 9999U) ? m_mediaInfoVer / 10U : m_mediaInfoVer; + if (!checkVersionStr(versionLib, mediaInfoVer / 100U, mediaInfoVer % 100U)) + { + qWarning("Invalid library version property: \"%s\"", MUTILS_UTF8(versionLib)); + return audioFile; + } + } + } + else + { + qWarning("Library version property not found!"); return audioFile; } while (findNextElement(QLatin1String("Media"), xmlStream))