Added ".hevc" file extension to the save file dialog.

This commit is contained in:
LoRd_MuldeR 2014-02-21 23:57:03 +01:00
parent 6f4a2c5493
commit 52eb860a9c
3 changed files with 27 additions and 7 deletions

View File

@ -32,7 +32,8 @@ X264_FILE_TYPE_FILTERS[] =
{
{ "mkv", "Matroska Files" },
{ "mp4", "MPEG-4 Part 14 Container" },
{ "264", "H.264 Elementary Stream"},
{ "264", "AVC/H.264 Elementary Stream"},
{ "hevc", "HEVC/H.264 Elementary Stream"},
};
class RecentlyUsed

View File

@ -26,7 +26,7 @@
#define VER_X264_MAJOR 2
#define VER_X264_MINOR 3
#define VER_X264_PATCH 1
#define VER_X264_BUILD 778
#define VER_X264_BUILD 779
#define VER_X264_MINIMUM_REV 2380
#define VER_X264_CURRENT_API 142

View File

@ -504,16 +504,30 @@ void AddJobDialog::accept(void)
return;
}
}
if(((sourceFile.suffix().compare("VPY", Qt::CaseInsensitive) == 0) || (sourceFile.suffix().compare("PY", Qt::CaseInsensitive) == 0)) && (!m_sysinfo->hasVPSSupport()))
else if(((sourceFile.suffix().compare("VPY", Qt::CaseInsensitive) == 0) || (sourceFile.suffix().compare("PY", Qt::CaseInsensitive) == 0)) && (!m_sysinfo->hasVPSSupport()))
{
if(QMessageBox::warning(this, tr("VapurSynth unsupported!"), tr("<nobr>A VapourSynth script was selected as input, although VapourSynth is <b>not/<b> available!</nobr>"), tr("Abort"), tr("Ingnore (at your own risk!)")) != 1)
{
return;
}
}
//Does output file already exist?
//Is output file extension supported by encoder
QFileInfo outputFile = QFileInfo(this->outputFile());
if((outputFile.suffix().compare("264", Qt::CaseInsensitive) == 0) && (ui->cbxEncoderType->currentIndex() == OptionsModel::EncType_X265))
{
QMessageBox::warning(this, tr("H.264 unsupported!"), tr("<nobr>Sorry, x265 cannot output H.264/AVC files!</nobr>"));
ui->editOutput->setText(QString("%1/%2.hevc").arg(outputFile.absolutePath(), outputFile.completeBaseName()));
return;
}
else if((outputFile.suffix().compare("HEVC", Qt::CaseInsensitive) == 0) && (ui->cbxEncoderType->currentIndex() == OptionsModel::EncType_X264))
{
QMessageBox::warning(this, tr("H.264 unsupported!"), tr("<nobr>Sorry, x264 cannot output H.265/HEVC files!</nobr>"));
ui->editOutput->setText(QString("%1/%2.264").arg(outputFile.absolutePath(), outputFile.completeBaseName()));
return;
}
//Does output file already exist?
if(outputFile.exists() && outputFile.isFile())
{
int ret = QMessageBox::question(this, tr("Already Exists!"), tr("<nobr>Output file already exists! Overwrite?</nobr>"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
@ -965,9 +979,14 @@ QString AddJobDialog::currentOutputPath(const bool bWithName)
int AddJobDialog::currentOutputIndx(void)
{
int index = m_recentlyUsed->filterIndex();
QString currentOutputFile = this->outputFile();
if(ui->cbxEncoderType->currentIndex() == OptionsModel::EncType_X265)
{
return ARRAY_SIZE(X264_FILE_TYPE_FILTERS) - 1;
}
int index = m_recentlyUsed->filterIndex();
const QString currentOutputFile = this->outputFile();
if(!currentOutputFile.isEmpty())
{
const QString currentOutputExtn = QFileInfo(currentOutputFile).suffix();