OSDN Git Service

Fixed detection of AAC streams with latest MediaInfo version. AAC profile is now...
authorLoRd_MuldeR <mulder2@gmx.de>
Fri, 7 Dec 2018 13:11:55 +0000 (14:11 +0100)
committerLoRd_MuldeR <mulder2@gmx.de>
Fri, 7 Dec 2018 13:11:55 +0000 (14:11 +0100)
src/Config.h
src/Decoder_AAC.cpp
src/Decoder_AAC.h
src/Thread_FileAnalyzer_Task.cpp

index fc4f52e..411bfad 100644 (file)
@@ -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
 
 ///////////////////////////////////////////////////////////////////////////////
index 39ac120..da75d47 100644 (file)
 #include <QDir>
 #include <QProcess>
 #include <QRegExp>
+#include <QMutexLocker>
+
+//Static
+QMutex AACDecoder::m_regexMutex;
+MUtils::Lazy<QRegExp> 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())
                                {
index 585d17f..91ec221 100644 (file)
@@ -23,6 +23,7 @@
 #pragma once
 
 #include "Decoder_Abstract.h"
+#include <MUtils/Lazy.h>
 
 class AACDecoder : public AbstractDecoder
 {
@@ -36,4 +37,6 @@ public:
 
 private:
        const QString m_binary;
+       static MUtils::Lazy<QRegExp> m_regxFeatures;
+       static QMutex m_regexMutex;
 };
index adb68b8..496daae 100644 (file)
@@ -104,6 +104,7 @@ static MUtils::Lazy<const QMap<QPair<AnalyzeTask::MI_trackType_t, QString>, 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);