Commit 499f5e0e authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix replacing proxied clip. Related to #1216

parent 54d859d0
Pipeline #88937 passed with stage
in 8 minutes and 54 seconds
......@@ -1633,9 +1633,13 @@ void Bin::slotReplaceClip()
sourceProps.insert(QStringLiteral("resource"), currentItem->url());
sourceProps.insert(QStringLiteral("kdenlive:originalurl"), currentItem->url());
sourceProps.insert(QStringLiteral("kdenlive:clipname"), currentItem->clipName());
sourceProps.insert(QStringLiteral("kdenlive:proxy"), currentItem->getProducerProperty(QStringLiteral("kdenlive:proxy")));
sourceProps.insert(QStringLiteral("_fullreload"), QStringLiteral("1"));
newProps.insert(QStringLiteral("resource"), fileName);
newProps.insert(QStringLiteral("kdenlive:originalurl"), fileName);
newProps.insert(QStringLiteral("kdenlive:clipname"), QFileInfo(fileName).fileName());
newProps.insert(QStringLiteral("kdenlive:proxy"), QStringLiteral("-"));
newProps.insert(QStringLiteral("_fullreload"), QStringLiteral("1"));
// Check if replacement clip is long enough
if (currentItem->hasLimitedDuration() && currentItem->isIncludedInTimeline()) {
// Clip is used in timeline, make sure length is similar
......
......@@ -1235,16 +1235,17 @@ void ProjectClip::setProperties(const QMap<QString, QString> &properties, bool r
if (m_clipType == ClipType::Color) {
refreshOnly = true;
updateRoles << TimelineModel::ResourceRole;
} else if (!properties.contains("kdenlive:proxy")) {
} else if (properties.contains("_fullreload")) {
// Clip resource changed, update thumbnail, name, clear hash
refreshOnly = false;
// Enforce reloading clip type in case of clip replacement
m_service.clear();
m_clipType = ClipType::Unknown;
clearBackupProperties();
updateRoles << TimelineModel::ResourceRole << TimelineModel::MaxDurationRole << TimelineModel::NameRole;
}
}
if (properties.contains(QStringLiteral("kdenlive:proxy"))) {
if (properties.contains(QStringLiteral("kdenlive:proxy")) && !properties.contains("_fullreload")) {
QString value = properties.value(QStringLiteral("kdenlive:proxy"));
// If value is "-", that means user manually disabled proxy on this clip
if (value.isEmpty() || value == QLatin1String("-")) {
......@@ -2119,7 +2120,7 @@ void ProjectClip::setInvalid()
void ProjectClip::updateProxyProducer(const QString &path)
{
setProducerProperty(QStringLiteral("_overwriteproxy"), QString());
resetProducerProperty(QStringLiteral("_overwriteproxy"));
setProducerProperty(QStringLiteral("resource"), path);
reloadProducer(false, true);
}
......
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