From caf835dbf9e6239191b8df8902ee45ebbd8f7b8d Mon Sep 17 00:00:00 2001 From: lordmulder Date: Fri, 20 Apr 2012 22:39:19 +0200 Subject: [PATCH] Better method to prevent MediaInfo from detecting playlist files. --- src/Config.h | 4 ++-- src/Thread_FileAnalyzer.cpp | 18 +++++++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/Config.h b/src/Config.h index 61820872..4ac04e24 100644 --- a/src/Config.h +++ b/src/Config.h @@ -29,8 +29,8 @@ #define VER_LAMEXP_MINOR_HI 0 #define VER_LAMEXP_MINOR_LO 4 #define VER_LAMEXP_TYPE RC -#define VER_LAMEXP_PATCH 3 -#define VER_LAMEXP_BUILD 985 +#define VER_LAMEXP_PATCH 4 +#define VER_LAMEXP_BUILD 986 /////////////////////////////////////////////////////////////////////////////// // Tool versions (minimum expected versions!) diff --git a/src/Thread_FileAnalyzer.cpp b/src/Thread_FileAnalyzer.cpp index 4690f717..4599a9d1 100644 --- a/src/Thread_FileAnalyzer.cpp +++ b/src/Thread_FileAnalyzer.cpp @@ -105,6 +105,7 @@ const char *FileAnalyzer::g_tags_gen[] = const char *FileAnalyzer::g_tags_aud[] = { "ID", + "Source", "Format", "Format_Profile", "Format_Version", @@ -383,21 +384,28 @@ void FileAnalyzer::updateInfo(AudioFileModel &audioFile, bool *skipNext, unsigne return; } - /*Skip?*/ + /*Skip or empty?*/ if((*skipNext) || value.isEmpty()) { return; } + /*Playlist file?*/ + if(IS_KEY("Aud_Source")) + { + *skipNext = true; + audioFile.setFormatContainerType(QString()); + audioFile.setFormatAudioType(QString()); + qWarning("Skipping info for playlist file!"); + return; + } + /*General Section*/ if(IS_SEC("Gen")) { if(IS_KEY("Gen_Format")) { - if(value.compare("HLS", Qt::CaseInsensitive)) //MediaInfo detects "HLS" for .m3u files, we'll ignore that - { - audioFile.setFormatContainerType(value); - } + audioFile.setFormatContainerType(value); } else if(IS_KEY("Gen_Format_Profile")) {