Apply "Force Stereo Downmix" only for sources with more than two channels.

This commit is contained in:
LoRd_MuldeR 2011-08-06 14:12:20 +02:00
parent fbee147f07
commit ce872af94c
4 changed files with 15 additions and 10 deletions

View File

@ -2607,23 +2607,23 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="755"/>
<location filename="../../src/Dialog_Processing.cpp" line="760"/>
<source>Playlist creation failed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="755"/>
<location filename="../../src/Dialog_Processing.cpp" line="760"/>
<source>The playlist file could not be created:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="795"/>
<location filename="../../src/Dialog_Processing.cpp" line="800"/>
<source>Warning: Computer will shutdown in %1 seconds...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Dialog_Processing.cpp" line="799"/>
<location filename="../../src/Dialog_Processing.cpp" line="800"/>
<location filename="../../src/Dialog_Processing.cpp" line="804"/>
<location filename="../../src/Dialog_Processing.cpp" line="805"/>
<source>Cancel Shutdown</source>
<translation type="unfinished"></translation>
</message>

View File

@ -30,7 +30,7 @@
#define VER_LAMEXP_MINOR_LO 3
#define VER_LAMEXP_TYPE Alpha
#define VER_LAMEXP_PATCH 8
#define VER_LAMEXP_BUILD 622
#define VER_LAMEXP_BUILD 623
///////////////////////////////////////////////////////////////////////////////
// Tools versions

View File

@ -552,6 +552,7 @@ void ProcessingDialog::startNextJob(void)
AbstractEncoder *encoder = NULL;
bool nativeResampling = false;
//Create encoder instance
switch(m_settings->compressionEncoder())
{
case SettingsModel::MP3Encoder:
@ -637,6 +638,7 @@ void ProcessingDialog::startNextJob(void)
throw "Unsupported encoder!";
}
//Create processing thread
ProcessThread *thread = new ProcessThread
(
currentFile,
@ -646,7 +648,8 @@ void ProcessingDialog::startNextJob(void)
m_settings->prependRelativeSourcePath()
);
if(m_settings->forceStereoDownmix() && !encoder->requiresDownmix())
//Add audio filters
if(m_settings->forceStereoDownmix() && (!encoder->requiresDownmix()) && ((currentFile.formatAudioChannels() > 2) || (currentFile.formatAudioChannels() == 0)))
{
thread->addFilter(new DownmixFilter());
}
@ -665,7 +668,7 @@ void ProcessingDialog::startNextJob(void)
{
thread->addFilter(new NormalizeFilter(m_settings->normalizationFilterMaxVolume()));
}
if(m_settings->renameOutputFilesEnabled())
if(m_settings->renameOutputFilesEnabled() && (!m_settings->renameOutputFilesPattern().simplified().isEmpty()))
{
thread->setRenamePattern(m_settings->renameOutputFilesPattern());
}
@ -673,12 +676,14 @@ void ProcessingDialog::startNextJob(void)
m_threadList.append(thread);
m_allJobs.append(thread->getId());
//Connect thread signals
connect(thread, SIGNAL(finished()), this, SLOT(doneEncoding()), Qt::QueuedConnection);
connect(thread, SIGNAL(processStateInitialized(QUuid,QString,QString,int)), m_progressModel, SLOT(addJob(QUuid,QString,QString,int)), Qt::QueuedConnection);
connect(thread, SIGNAL(processStateChanged(QUuid,QString,int)), m_progressModel, SLOT(updateJob(QUuid,QString,int)), Qt::QueuedConnection);
connect(thread, SIGNAL(processStateFinished(QUuid,QString,bool)), this, SLOT(processFinished(QUuid,QString,bool)), Qt::QueuedConnection);
connect(thread, SIGNAL(processMessageLogged(QUuid,QString)), m_progressModel, SLOT(appendToLog(QUuid,QString)), Qt::QueuedConnection);
//Give it a go!
m_runningThreads++;
thread->start();
}

View File

@ -128,14 +128,14 @@ void ProcessThread::processFile()
return;
}
//Do we need to take of downsampling the input?
//Do we need to take care of downsampling the input?
if(m_encoder->requiresDownsample())
{
insertDownsampleFilter();
}
//Do we need Stereo downmix?
if(m_audioFile.formatAudioChannels() > 2 && m_encoder->requiresDownmix())
if(((m_audioFile.formatAudioChannels() > 2) || (m_audioFile.formatAudioChannels() == 0)) && m_encoder->requiresDownmix())
{
m_filters.prepend(new DownmixFilter());
}