From: lordmulder Date: Thu, 8 Mar 2012 23:44:55 +0000 (+0100) Subject: Some workarounds for FLAC. It seems FLAC doesn't like 1.0, 3.0, 3.1, 4.0 channel... X-Git-Tag: Release_404~63 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=53af74148d9ba3ae02166c7b8c7817ec32a90675;p=lamexp%2FLameXP.git Some workarounds for FLAC. It seems FLAC doesn't like 1.0, 3.0, 3.1, 4.0 channel files. It also doesn't like more than 6 channels. It still fails with files that have >2 channels and are NOT in the "Wave Extensible" format. --- diff --git a/src/Config.h b/src/Config.h index 3e6433d7..f1bcf712 100644 --- a/src/Config.h +++ b/src/Config.h @@ -30,7 +30,7 @@ #define VER_LAMEXP_MINOR_LO 4 #define VER_LAMEXP_TYPE Beta #define VER_LAMEXP_PATCH 5 -#define VER_LAMEXP_BUILD 903 +#define VER_LAMEXP_BUILD 904 /////////////////////////////////////////////////////////////////////////////// // Tool versions (minimum expected versions!) diff --git a/src/Encoder_FLAC.cpp b/src/Encoder_FLAC.cpp index ba3662d5..c177aabf 100644 --- a/src/Encoder_FLAC.cpp +++ b/src/Encoder_FLAC.cpp @@ -149,3 +149,15 @@ bool FLACEncoder::isFormatSupported(const QString &containerType, const QString return false; } + +const unsigned int *FLACEncoder::supportedChannelCount(void) +{ + static const unsigned int supportedChannels[] = {2, 5, 6, NULL}; + return supportedChannels; +} + +const unsigned int *FLACEncoder::supportedBitdepths(void) +{ + static const unsigned int supportedBPS[] = {16, 24, NULL}; + return supportedBPS; +} diff --git a/src/Encoder_FLAC.h b/src/Encoder_FLAC.h index 1568f4ac..7b190895 100644 --- a/src/Encoder_FLAC.h +++ b/src/Encoder_FLAC.h @@ -36,6 +36,8 @@ public: virtual bool encode(const QString &sourceFile, const AudioFileModel &metaInfo, const QString &outputFile, volatile bool *abortFlag); virtual bool isFormatSupported(const QString &containerType, const QString &containerProfile, const QString &formatType, const QString &formatProfile, const QString &formatVersion); virtual QString extension(void); + virtual const unsigned int *supportedChannelCount(void); + virtual const unsigned int *supportedBitdepths(void); private: const QString m_binary; diff --git a/src/Filter_Downmix.cpp b/src/Filter_Downmix.cpp index 53596f2e..c4804211 100644 --- a/src/Filter_Downmix.cpp +++ b/src/Filter_Downmix.cpp @@ -48,10 +48,10 @@ bool DownmixFilter::apply(const QString &sourceFile, const QString &outputFile, unsigned int channels = formatInfo->formatAudioChannels(); //detectChannels(sourceFile, abortFlag); emit messageLogged(QString().sprintf("--> Number of channels is: %d\n", channels)); - if((channels == 1) || (channels == 2)) + if(channels == 2) { messageLogged("Skipping downmix!"); - qDebug("Dowmmix not required for Mono or Stereo input, skipping!"); + qDebug("Dowmmix not required for Stereo input, skipping!"); return true; } @@ -67,6 +67,8 @@ bool DownmixFilter::apply(const QString &sourceFile, const QString &outputFile, switch(channels) { + case 2: //Unknown + qWarning("Downmixer: Nothing to do!"); case 3: //3.0 (L/R/C) args << "remix" << "1v0.66,3v0.34" << "2v0.66,3v0.34"; break;