Commit 6c6f3146 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle

Workaround MLT consumer scaling issue #453 by using multi consumer

Enforce in/out that were not correctly passed with movit or multi consumer
CCBUG: 407678
parent 784454e3
Pipeline #4056 passed with stage
in 28 minutes and 18 seconds
......@@ -113,18 +113,24 @@ int main(int argc, char **argv)
}
int in = -1;
int out = -1;
if (LIBMLT_VERSION_INT < 396544) {
// older MLT version, does not support consumer in/out, so read it manually
QFile f(playlist);
QDomDocument doc;
doc.setContent(&f, false);
f.close();
QDomElement consumer = doc.documentElement().firstChildElement(QStringLiteral("consumer"));
if (!consumer.isNull()) {
in = consumer.attribute("in").toInt();
out = consumer.attribute("out").toInt();
// older MLT version, does not support embeded consumer in/out in xml, and current
// MLT (6.16) does not pass it onto the multi / movit consumer, so read it manually and enforce
QFile f(playlist);
QDomDocument doc;
doc.setContent(&f, false);
f.close();
QDomElement consumer = doc.documentElement().firstChildElement(QStringLiteral("consumer"));
if (!consumer.isNull()) {
in = consumer.attribute("in").toInt();
out = consumer.attribute("out").toInt();
if (consumer.hasAttribute(QLatin1String("s")) || consumer.hasAttribute(QLatin1String("r"))) {
// Workaround MLT embeded consumer resize (MLT issue #453)
playlist.prepend(QStringLiteral("xml:"));
playlist.append(QStringLiteral("?multi=1"));
}
}
auto *rJob = new RenderJob(render, playlist, target, pid, in, out);
rJob->start();
return app.exec();
......
......@@ -42,8 +42,8 @@ RenderJob::RenderJob(const QString &render, const QString &scenelist, const QStr
, m_jobUiserver(nullptr)
, m_kdenliveinterface(nullptr)
, m_usekuiserver(true)
, m_logfile(scenelist + QStringLiteral(".txt"))
, m_erase(scenelist.startsWith(QDir::tempPath()))
, m_logfile(scenelist.startsWith(QStringLiteral("xml:")) ? scenelist.section(QLatin1Char(':'), 1).section(QLatin1Char('?'), 0, -2) + QStringLiteral(".txt") : scenelist + QStringLiteral(".txt"))
, m_erase(scenelist.startsWith(QDir::tempPath()) || scenelist.startsWith(QString("xml:%2").arg(QDir::tempPath())))
, m_seconds(0)
, m_frame(0)
, m_pid(pid)
......
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