Fix path corruption on clip reload

CCBUG: 371965
parent 33b99317
......@@ -864,6 +864,7 @@ void Bin::slotReloadClip()
emit openClip(NULL);
QDomDocument doc;
QDomElement xml = currentItem->toXml(doc);
qDebug()<<"*****************\n"<<doc.toString()<<"\n******************";
if (!xml.isNull()) {
currentItem->setClipStatus(AbstractProjectItem::StatusWaiting);
// We need to set a temporary id before all outdated producers are replaced;
......
......@@ -427,8 +427,7 @@ QString BinController::xmlFromId(const QString & id)
QString BinController::getProducerXML(Mlt::Producer &producer, bool includeMeta)
{
QString filename = QStringLiteral("string");
Mlt::Consumer c(*producer.profile(), "xml", filename.toUtf8().constData());
Mlt::Consumer c(*producer.profile(), "xml", "string");
Mlt::Service s(producer.get_service());
if (!s.is_valid())
return QLatin1String("");
......@@ -438,15 +437,13 @@ QString BinController::getProducerXML(Mlt::Producer &producer, bool includeMeta)
c.set("time_format", "frames");
if (!includeMeta) c.set("no_meta", 1);
c.set("store", "kdenlive");
if (filename != QLatin1String("string")) {
c.set("no_root", 1);
c.set("root", QFileInfo(filename).absolutePath().toUtf8().constData());
}
c.set("no_root", 1);
c.set("root", "/");
c.connect(s);
c.start();
if (ignore)
s.set("ignore_points", ignore);
return QString::fromUtf8(c.get(filename.toUtf8().constData()));
return QString::fromUtf8(c.get("string"));
}
ClipController *BinController::getController(const QString &id)
......
......@@ -559,13 +559,13 @@ const QString Render::sceneList(const QString root)
QString playlist;
qDebug()<<" * * *Setting document xml root: "<<root;
Mlt::Consumer xmlConsumer(*m_qmlView->profile(), "xml:kdenlive_playlist");
if (!root.isEmpty())
xmlConsumer.set("root", root.toUtf8().constData());
//qDebug()<<" ++ + READY TO SAVE: "<<m_qmlView->profile()->width()<<" / "<<m_qmlView->profile()->description();
if (!xmlConsumer.is_valid()) return QString();
m_mltProducer->optimise();
xmlConsumer.set("terminate_on_pause", 1);
xmlConsumer.set("store", "kdenlive");
if (!root.isEmpty())
xmlConsumer.set("root", root.toUtf8().constData());
// Disabling meta creates cleaner files, but then we don't have access to metadata on the fly (meta channels, etc)
// And we must use "avformat" instead of "avformat-novalidate" on project loading which causes a big delay on project opening
//xmlConsumer.set("no_meta", 1);
......@@ -1610,6 +1610,7 @@ void Render::preparePreviewRendering(const QString sceneListFile)
return;
m_mltProducer->optimise();
xmlConsumer.set("terminate_on_pause", 1);
xmlConsumer.set("no_meta", 1);
Mlt::Producer prod(m_mltProducer->get_producer());
if (!prod.is_valid())
return;
......
......@@ -167,6 +167,8 @@ const QByteArray Clip::xml()
c.connect(s);
c.set("time_format", "frames");
c.set("no_meta", 1);
c.set("no_root", 1);
c.set("root", "/");
c.set("store", "kdenlive");
c.start();
if (ignore) s.set("ignore_points", ignore);
......
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