Updated MediaInfo binary to a current SVN/Trunk version with Opus support. Also removed the preliminary Opus detection hack.

This commit is contained in:
LoRd_MuldeR 2012-08-01 00:17:12 +02:00
parent 87ebf07930
commit 2cd7fb1faf
10 changed files with 29 additions and 48 deletions

View File

@ -452,7 +452,13 @@ del "$(TargetDir)imageformats\q???d4.dll"
<ClCompile Include="src\Thread_CueSplitter.cpp" />
<ClCompile Include="src\Thread_DiskObserver.cpp" />
<ClCompile Include="src\Thread_FileAnalyzer.cpp" />
<ClCompile Include="src\Thread_FileAnalyzer_ST.cpp" />
<ClCompile Include="src\Thread_FileAnalyzer_ST.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_Qt5|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_Static_Qt5|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="src\Thread_FileAnalyzer_Task.cpp" />
<ClCompile Include="src\Thread_Initialization.cpp" />
<ClCompile Include="src\Thread_MessageHandler.cpp" />

Binary file not shown.

Binary file not shown.

View File

@ -30,7 +30,7 @@
#define VER_LAMEXP_MINOR_LO 5
#define VER_LAMEXP_TYPE Alpha
#define VER_LAMEXP_PATCH 12
#define VER_LAMEXP_BUILD 1067
#define VER_LAMEXP_BUILD 1068
///////////////////////////////////////////////////////////////////////////////
// Tool versions (minimum expected versions!)

View File

@ -50,6 +50,7 @@ AudioFileModel::AudioFileModel(const AudioFileModel &model, bool copyMetaInfo)
setFormatAudioType(model.m_formatAudioType);
setFormatAudioProfile(model.m_formatAudioProfile);
setFormatAudioVersion(model.m_formatAudioVersion);
setFormatAudioEncodeLib(model.m_formatAudioEncodeLib);
setFormatAudioSamplerate(model.m_formatAudioSamplerate);
setFormatAudioChannels(model.m_formatAudioChannels);
setFormatAudioBitdepth(model.m_formatAudioBitdepth);
@ -88,6 +89,7 @@ AudioFileModel &AudioFileModel::operator=(const AudioFileModel &model)
setFormatAudioType(model.m_formatAudioType);
setFormatAudioProfile(model.m_formatAudioProfile);
setFormatAudioVersion(model.m_formatAudioVersion);
setFormatAudioEncodeLib(model.m_formatAudioEncodeLib);
setFormatAudioSamplerate(model.m_formatAudioSamplerate);
setFormatAudioChannels(model.m_formatAudioChannels);
setFormatAudioBitdepth(model.m_formatAudioBitdepth);
@ -124,6 +126,7 @@ void AudioFileModel::resetAll(void)
m_formatAudioType.clear();
m_formatAudioProfile.clear();
m_formatAudioVersion.clear();
m_formatAudioEncodeLib.clear();
m_formatAudioSamplerate = 0;
m_formatAudioChannels = 0;
@ -328,6 +331,10 @@ const QString AudioFileModel::formatAudioCompressInfo(void) const
break;
}
}
if(!m_formatAudioEncodeLib.isEmpty())
{
info.append(QString(", %1: %2").arg(tr("Encoder"), m_formatAudioEncodeLib));
}
return info;
}
else
@ -420,6 +427,11 @@ void AudioFileModel::setFormatAudioVersion(const QString &version)
m_formatAudioVersion = version;
}
void AudioFileModel::setFormatAudioEncodeLib(const QString &encodeLib)
{
m_formatAudioEncodeLib = encodeLib;
}
void AudioFileModel::setFormatAudioSamplerate(unsigned int samplerate)
{
m_formatAudioSamplerate = samplerate;

View File

@ -97,6 +97,7 @@ public:
void setFormatAudioType(const QString &type);
void setFormatAudioProfile(const QString &profile);
void setFormatAudioVersion(const QString &version);
void setFormatAudioEncodeLib(const QString &encodeLib);
void setFormatAudioSamplerate(unsigned int samplerate);
void setFormatAudioChannels(unsigned int channels);
void setFormatAudioBitdepth(unsigned int bitdepth);
@ -122,6 +123,7 @@ private:
QString m_formatAudioType;
QString m_formatAudioProfile;
QString m_formatAudioVersion;
QString m_formatAudioEncodeLib;
unsigned int m_formatAudioSamplerate;
unsigned int m_formatAudioChannels;
unsigned int m_formatAudioBitdepth;

View File

@ -99,6 +99,7 @@ const char *FileAnalyzer::g_tags_aud[] =
"BitDepth",
"BitRate",
"BitRate_Mode",
"Encoded_Library",
NULL
};

View File

@ -173,27 +173,6 @@ void AnalyzeTask::run_ex(void)
qWarning("Cue Sheet file detected, skipping!");
s_filesCueSheet++;
}
else if((!QFileInfo(currentFile).suffix().compare("opus", Qt::CaseInsensitive)) || (!QFileInfo(currentFile).suffix().compare("ogg", Qt::CaseInsensitive)))
{
qDebug("Found a potential Opus audio file, investigating...");
QFile opusTest(currentFile);
if(analyzeOpusFile(currentFile, file))
{
qDebug("Accepted Opus file: %s", file.filePath().toUtf8().constData());
QWriteLocker lock(&s_lock);
s_filesAccepted++;
s_recentlyAdded.insert(file.filePath().toLower());
lock.unlock();
waitForPreviousThreads();
emit fileAnalyzed(file);
}
else
{
QWriteLocker lock(&s_lock);
qDebug("Rejected Opus file: %s", file.filePath().toUtf8().constData());
s_filesRejected++;
}
}
else if(!QFileInfo(currentFile).suffix().compare("avs", Qt::CaseInsensitive))
{
qDebug("Found a potential Avisynth script, investigating...");
@ -535,6 +514,10 @@ void AnalyzeTask::updateInfo(AudioFileModel &audioFile, bool *skipNext, unsigned
if(!value.compare("CBR", Qt::CaseInsensitive)) audioFile.setFormatAudioBitrateMode(AudioFileModel::BitrateModeConstant);
if(!value.compare("VBR", Qt::CaseInsensitive)) audioFile.setFormatAudioBitrateMode(AudioFileModel::BitrateModeVariable);
}
else if(IS_KEY("Aud_Encoded_Library"))
{
audioFile.setFormatAudioEncodeLib(value);
}
else
{
qWarning("Unknown key '%s' with value '%s' found!", key.toUtf8().constData(), value.toUtf8().constData());
@ -592,28 +575,6 @@ void AnalyzeTask::retrieveCover(AudioFileModel &audioFile, cover_t coverType, co
}
}
bool AnalyzeTask::analyzeOpusFile(const QString &filePath, AudioFileModel &info)
{
QFile opusFile(filePath);
if(opusFile.open(QIODevice::ReadOnly))
{
QByteArray data = opusFile.peek(1024);
int idx1 = data.indexOf(QString::fromAscii("OggS"));
int idx2 = data.indexOf(QString::fromAscii("OpusHead"));
if((idx1 >= 0) && (idx2 > idx1))
{
info.setFormatContainerType("OGG");
info.setFormatAudioType("Opus");
opusFile.close();
return true;
}
opusFile.close();
return false;
}
return false;
}
bool AnalyzeTask::analyzeAvisynthFile(const QString &filePath, AudioFileModel &info)
{
QProcess process;

View File

@ -90,7 +90,6 @@ private:
bool checkFile_CDDA(QFile &file);
void retrieveCover(AudioFileModel &audioFile, cover_t coverType, const QByteArray &coverData);
bool analyzeAvisynthFile(const QString &filePath, AudioFileModel &info);
bool analyzeOpusFile(const QString &filePath, AudioFileModel &info);
void waitForPreviousThreads(void);
const unsigned __int64 m_threadIdx;

View File

@ -65,8 +65,8 @@ g_lamexp_tools[] =
{"3fd15a6b5b0120794650f1dcd0c35f147cc21576e78f17425288bfacbad0b14696186739", CPU_TYPE_ALL_GEN, "lame.i386.exe", 3995},
{"069a79d843939a65d8578f51b6acd09de95d44362c6a9c74e92a6e73ba40aea07916f7c4", CPU_TYPE_ALL_SSE, "lame.sse2.exe", 3995},
{"d4d806fc3d0a36ef357ea43b870c7e46de9c18be9920f451314d72d02ba0fe4f7c867d9c", CPU_TYPE_ALL_ALL, "mac.exe", 411},
{"a2aec43c15c6286cfbff9102deeea32dc2e357aa435f1a012f6d18bb91ffdbf328595946", CPU_TYPE_X86_ALL, "mediainfo.i386.exe", 758},
{"7265211b9380b8c0171181596a1aa13dfbce32ad701c22db6d5f9a9e5449c8a13ab407b1", CPU_TYPE_X64_ALL, "mediainfo.x64.exe", 758},
{"ca9804ecbe15a760a499943327ae105755cfc946648ea76d197782029f2fb008543680c9", CPU_TYPE_X86_ALL, "mediainfo.i386.exe", 758},
{"233d0f25cc224f8174d953353ac1a4a09fd0e22ef1ff8f6323ab4980d6d33fbea179022f", CPU_TYPE_X64_ALL, "mediainfo.x64.exe", 758},
{"ed49bfeb5113e8eca4f2f5c5c9359f6edeecf457cff8511178902c7d792380eaa578d9bc", CPU_TYPE_ALL_ALL, "mpcdec.exe", 475},
{"adea5dd78d54abc9031a48a6ebb94f3375da87a7340e1f99f4a3660fbb6d163e144fe95b", CPU_TYPE_ALL_ALL, "mpg123.exe", 1143},
{"0c781805dda931c529bd16069215f616a7a4c5e5c2dfb6b75fe85d52b20511830693e528", CPU_TYPE_ALL_ALL, "oggdec.exe", UINT_MAX},