From 4e984329f07a1f2d2ac89dd6a2aaeaf8d87355ae Mon Sep 17 00:00:00 2001 From: LoRd_MuldeR Date: Fri, 7 Dec 2018 14:11:55 +0100 Subject: [PATCH] Fixed detection of AAC streams with latest MediaInfo version. AAC profile is now stored in "Format_AdditionalFeatures" tag. --- src/Config.h | 2 +- src/Decoder_AAC.cpp | 11 ++++++++++- src/Decoder_AAC.h | 3 +++ src/Thread_FileAnalyzer_Task.cpp | 1 + 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/Config.h b/src/Config.h index fc4f52e4..411bfad5 100644 --- a/src/Config.h +++ b/src/Config.h @@ -35,7 +35,7 @@ #define VER_LAMEXP_MINOR_LO 8 #define VER_LAMEXP_TYPE Alpha #define VER_LAMEXP_PATCH 2 -#define VER_LAMEXP_BUILD 2194 +#define VER_LAMEXP_BUILD 2196 #define VER_LAMEXP_CONFG 2188 /////////////////////////////////////////////////////////////////////////////// diff --git a/src/Decoder_AAC.cpp b/src/Decoder_AAC.cpp index 39ac1207..da75d475 100644 --- a/src/Decoder_AAC.cpp +++ b/src/Decoder_AAC.cpp @@ -32,6 +32,14 @@ #include #include #include +#include + +//Static +QMutex AACDecoder::m_regexMutex; +MUtils::Lazy AACDecoder::m_regxFeatures([] +{ + return new QRegExp(L1S("\\bLC\\b"), Qt::CaseInsensitive); +}); AACDecoder::AACDecoder(void) : @@ -90,7 +98,8 @@ bool AACDecoder::isFormatSupported(const QString &containerType, const QString & { if(formatType.compare(QLatin1String("AAC"), Qt::CaseInsensitive) == 0) { - if((formatProfile.compare(QLatin1String("LC"), Qt::CaseInsensitive) == 0) || (formatProfile.compare(QLatin1String("HE-AAC"), Qt::CaseInsensitive) == 0) || (formatProfile.compare(QLatin1String("HE-AACv2"), Qt::CaseInsensitive) == 0)) + QMutexLocker lock(&m_regexMutex); + if ((*m_regxFeatures).indexIn(formatProfile) >= 0) { if((formatVersion.compare(QLatin1String("2"), Qt::CaseInsensitive) == 0) || (formatVersion.compare(QLatin1String("4"), Qt::CaseInsensitive) == 0) || formatVersion.isEmpty()) { diff --git a/src/Decoder_AAC.h b/src/Decoder_AAC.h index 585d17f0..91ec221d 100644 --- a/src/Decoder_AAC.h +++ b/src/Decoder_AAC.h @@ -23,6 +23,7 @@ #pragma once #include "Decoder_Abstract.h" +#include class AACDecoder : public AbstractDecoder { @@ -36,4 +37,6 @@ public: private: const QString m_binary; + static MUtils::Lazy m_regxFeatures; + static QMutex m_regexMutex; }; diff --git a/src/Thread_FileAnalyzer_Task.cpp b/src/Thread_FileAnalyzer_Task.cpp index adb68b84..496daaea 100644 --- a/src/Thread_FileAnalyzer_Task.cpp +++ b/src/Thread_FileAnalyzer_Task.cpp @@ -104,6 +104,7 @@ static MUtils::Lazy, Anal ADD_PROPTERY_MAPPING_1(aud, format); ADD_PROPTERY_MAPPING_1(aud, format_version); ADD_PROPTERY_MAPPING_1(aud, format_profile); + ADD_PROPTERY_MAPPING_2(aud, format_additionalfeatures, format_profile); ADD_PROPTERY_MAPPING_1(aud, duration); ADD_PROPTERY_MAPPING_1(aud, channel_s_); ADD_PROPTERY_MAPPING_1(aud, samplingrate);