Fix timeline preview with HD 24fps profile

CCBUG: 364106
parent df188f8f
......@@ -45,7 +45,7 @@ EncodingProfilesDialog::EncodingProfilesDialog(int profileType, QWidget * parent
button_edit->setIcon(KoIconUtils::themedIcon(QStringLiteral("document-edit")));
button_delete->setIcon(KoIconUtils::themedIcon(QStringLiteral("list-remove")));
button_download->setIcon(KoIconUtils::themedIcon(QStringLiteral("download")));
m_configFile = new KConfig(QStringLiteral("encodingprofiles.rc"), KConfig::CascadeConfig, QStandardPaths::DataLocation);
profile_type->setCurrentIndex(profileType);
connect(profile_type, SIGNAL(currentIndexChanged(int)), this, SLOT(slotLoadProfiles()));
......@@ -172,7 +172,7 @@ void EncodingProfilesDialog::slotEditProfile()
connect(box, &QDialogButtonBox::rejected, d.data(), &QDialog::reject);
l->addWidget(box);
d->setLayout(l);
QListWidgetItem *item = profile_list->currentItem();
if (item) {
pname->setText(item->text());
......@@ -182,7 +182,7 @@ void EncodingProfilesDialog::slotEditProfile()
pparams->setFocus();
}
if (d->exec() == QDialog::Accepted) {
m_configGroup->writeEntry(pname->text(), pparams->toPlainText() + ';' + pext->text());
m_configGroup->writeEntry(pname->text(), pparams->toPlainText().simplified() + ';' + pext->text());
slotLoadProfiles();
}
delete d;
......
......@@ -1552,6 +1552,7 @@ void KdenliveDoc::selectPreviewProfile()
// Check for frame rate
QString params = i.value();
QStringList data = i.value().split(" ");
// Check for size mismatch
if (params.contains(QStringLiteral("s="))) {
QString paramSize = params.section(QStringLiteral("s="), 1).section(QStringLiteral(" "), 0, 0);
if (paramSize != profileSize)
......
......@@ -182,21 +182,22 @@ void PreviewManager::disconnectTrack()
bool PreviewManager::loadParams()
{
m_extension= m_doc->getDocumentProperty(QStringLiteral("previewextension"));
m_consumerParams = m_doc->getDocumentProperty(QStringLiteral("previewparameters")).split(" ");
m_consumerParams = m_doc->getDocumentProperty(QStringLiteral("previewparameters")).split(" ", QString::SkipEmptyParts);
if (m_consumerParams.isEmpty() || m_extension.isEmpty()) {
m_doc->selectPreviewProfile();
m_consumerParams = m_doc->getDocumentProperty(QStringLiteral("previewparameters")).split(" ");
m_consumerParams = m_doc->getDocumentProperty(QStringLiteral("previewparameters")).split(" ", QString::SkipEmptyParts);
m_extension= m_doc->getDocumentProperty(QStringLiteral("previewextension"));
}
if (m_consumerParams.isEmpty() || m_extension.isEmpty()) {
return false;
}
//remove the r=... parameter (forcing framerate) as it causes rendering failure
// Remove the r= and s= parameter (forcing framerate / frame size) as it causes rendering failure.
// These parameters should be provided by MLT's profile
for (int i = 0; i < m_consumerParams.count(); i++) {
if (m_consumerParams.at(i).startsWith(QStringLiteral("r="))) {
if (m_consumerParams.at(i).startsWith(QStringLiteral("r=")) || m_consumerParams.at(i).startsWith(QStringLiteral("s="))) {
m_consumerParams.removeAt(i);
break;
i--;
}
}
m_consumerParams << "an=1";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment