OSDN Git Service

Some workarounds for FLAC. It seems FLAC doesn't like 1.0, 3.0, 3.1, 4.0 channel...
authorlordmulder <mulder2@gmx.de>
Thu, 8 Mar 2012 23:44:55 +0000 (00:44 +0100)
committerlordmulder <mulder2@gmx.de>
Thu, 8 Mar 2012 23:44:55 +0000 (00:44 +0100)
src/Config.h
src/Encoder_FLAC.cpp
src/Encoder_FLAC.h
src/Filter_Downmix.cpp

index 3e6433d..f1bcf71 100644 (file)
@@ -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!)
index ba3662d..c177aab 100644 (file)
@@ -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;
+}
index 1568f4a..7b19089 100644 (file)
@@ -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;
index 53596f2..c480421 100644 (file)
@@ -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;