summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Mardelle <jb@kdenlive.org>2016-11-04 10:01:46 (GMT)
committerJean-Baptiste Mardelle <jb@kdenlive.org>2016-11-04 10:02:12 (GMT)
commit41565402d462e0853241e822f51d056f12f6634a (patch)
tree43ffbaa0516656a928ca47b213162eda3f2cf79a
parent33b993178c15887f96af7d212f4f4c17af5dddda (diff)
Fix path corruption on clip reload
CCBUG: 371965
-rw-r--r--src/bin/bin.cpp1
-rw-r--r--src/mltcontroller/bincontroller.cpp11
-rw-r--r--src/renderer.cpp5
-rw-r--r--src/timeline/clip.cpp2
4 files changed, 10 insertions, 9 deletions
diff --git a/src/bin/bin.cpp b/src/bin/bin.cpp
index 3125ce5..92fed99 100644
--- a/src/bin/bin.cpp
+++ b/src/bin/bin.cpp
@@ -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;
diff --git a/src/mltcontroller/bincontroller.cpp b/src/mltcontroller/bincontroller.cpp
index d2507db..a589e58 100644
--- a/src/mltcontroller/bincontroller.cpp
+++ b/src/mltcontroller/bincontroller.cpp
@@ -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)
diff --git a/src/renderer.cpp b/src/renderer.cpp
index 6902d23..e86f4b1 100644
--- a/src/renderer.cpp
+++ b/src/renderer.cpp
@@ -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;
diff --git a/src/timeline/clip.cpp b/src/timeline/clip.cpp
index 72d08d6..d609e21 100644
--- a/src/timeline/clip.cpp
+++ b/src/timeline/clip.cpp
@@ -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);