Fix some bin clip properties not saved after change

parent 5cdfe091
......@@ -816,8 +816,8 @@ void ProjectClip::setProperties(const QMap<QString, QString> &properties, bool r
refreshPanel = true;
}
// Some properties also need to be passed to track producers
QStringList timelineProperties {QStringLiteral("force_aspect_ratio"),QStringLiteral("video_index"), QStringLiteral("audio_index"),QStringLiteral("set.force_full_luma"),QStringLiteral("full_luma"),QStringLiteral("threads"),QStringLiteral("force_colorspace"),QStringLiteral("force_tff"),QStringLiteral("force_progressive"),QStringLiteral("force_fps"),QStringLiteral("video_index"),QStringLiteral("audio_index")};
QStringList forceReloadProperties{QStringLiteral("set.test_image"),QStringLiteral("set.test_audio"),QStringLiteral("autorotate"),QStringLiteral("templatetext"),QStringLiteral("resource")};
QStringList timelineProperties {QStringLiteral("force_aspect_ratio"),QStringLiteral("video_index"), QStringLiteral("audio_index"),QStringLiteral("set.force_full_luma"),QStringLiteral("full_luma"),QStringLiteral("threads"),QStringLiteral("force_colorspace"),QStringLiteral("force_tff"),QStringLiteral("force_progressive"),QStringLiteral("video_index"),QStringLiteral("audio_index")};
QStringList forceReloadProperties{QStringLiteral("autorotate"),QStringLiteral("templatetext"),QStringLiteral("resource"),QStringLiteral("force_fps"),QStringLiteral("set.test_image"),QStringLiteral("set.test_audio")};
QStringList keys {QStringLiteral("luma_duration"),QStringLiteral("luma_file"),QStringLiteral("fade"),QStringLiteral("ttl"),QStringLiteral("softness"),QStringLiteral("crop"),QStringLiteral("animation")};
QVector<int> updateRoles;
while (i.hasNext()) {
......
......@@ -246,8 +246,9 @@ bool LoadJob::startJob()
}
m_resource = Xml::getXmlProperty(m_xml, QStringLiteral("resource"));
ClipType::ProducerType type = static_cast<ClipType::ProducerType>(m_xml.attribute(QStringLiteral("type")).toInt());
QString service = Xml::getXmlProperty(m_xml, QStringLiteral("mlt_service"));
if (type == ClipType::Unknown) {
type = getTypeForService(Xml::getXmlProperty(m_xml, QStringLiteral("mlt_service")), m_resource);
type = getTypeForService(service, m_resource);
}
switch (type) {
case ClipType::Color:
......@@ -265,7 +266,12 @@ bool LoadJob::startJob()
break;
case ClipType::SlideShow:
default:
m_producer = std::make_shared<Mlt::Producer>(pCore->getCurrentProfile()->profile(), nullptr, m_resource.toUtf8().constData());
if (!service.isEmpty()) {
service.append(QChar(':'));
m_producer = loadResource(m_resource, service);
} else {
m_producer = std::make_shared<Mlt::Producer>(pCore->getCurrentProfile()->profile(), nullptr, m_resource.toUtf8().constData());
}
break;
}
if (!m_producer || m_producer->is_blank() || !m_producer->is_valid()) {
......
......@@ -305,18 +305,20 @@ void ClipController::updateProducer(const std::shared_ptr<Mlt::Producer> &produc
} else {
m_usesProxy = false;
}
passProperties.pass_list(*m_properties, getPassPropertiesList(m_usesProxy));
// This is necessary as some properties like set.test_audio are reset on producer creation
const char *passList = getPassPropertiesList(m_usesProxy);
passProperties.pass_list(*m_properties, passList);
delete m_properties;
*m_masterProducer = producer.get();
checkAudioVideo();
m_properties = new Mlt::Properties(m_masterProducer->get_properties());
// Pass properties from previous producer
m_properties->pass_list(passProperties, getPassPropertiesList(m_usesProxy));
m_producerLock.unlock();
m_properties->pass_list(passProperties, passList);
if (!m_masterProducer->is_valid()) {
qCDebug(KDENLIVE_LOG) << "// WARNING, USING INVALID PRODUCER";
} else {
m_effectStack->resetService(m_masterProducer);
emitProducerChanged(m_controllerBinId, producer);
// URL and name shoule not be updated otherwise when proxying a clip we cannot find back the original url
/*m_url = QUrl::fromLocalFile(m_masterProducer->get("resource"));
if (m_url.isValid()) {
......@@ -324,6 +326,7 @@ void ClipController::updateProducer(const std::shared_ptr<Mlt::Producer> &produc
}
*/
}
m_producerLock.unlock();
qDebug() << "// replace finished: " << binId() << " : " << m_masterProducer->get("resource");
}
......
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