Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
2981c558
Commit
2981c558
authored
Oct 12, 2021
by
Jean-Baptiste Mardelle
Browse files
Fix replacing AV clip with playlist clip broken.
Related to
#1216
parent
0884e41a
Pipeline
#88115
passed with stage
in 8 minutes and 51 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/bin/bin.cpp
View file @
2981c558
...
...
@@ -1631,8 +1631,10 @@ void Bin::slotReplaceClip()
QMap
<
QString
,
QString
>
sourceProps
;
QMap
<
QString
,
QString
>
newProps
;
sourceProps
.
insert
(
QStringLiteral
(
"resource"
),
currentItem
->
url
());
sourceProps
.
insert
(
QStringLiteral
(
"kdenlive:originalurl"
),
currentItem
->
url
());
sourceProps
.
insert
(
QStringLiteral
(
"kdenlive:clipname"
),
currentItem
->
clipName
());
newProps
.
insert
(
QStringLiteral
(
"resource"
),
fileName
);
newProps
.
insert
(
QStringLiteral
(
"kdenlive:originalurl"
),
fileName
);
newProps
.
insert
(
QStringLiteral
(
"kdenlive:clipname"
),
QFileInfo
(
fileName
).
fileName
());
// Check if replacement clip is long enough
if
(
currentItem
->
hasLimitedDuration
()
&&
currentItem
->
isIncludedInTimeline
())
{
...
...
src/bin/projectclip.cpp
View file @
2981c558
...
...
@@ -28,6 +28,7 @@ SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
#include
"projectfolder.h"
#include
"projectitemmodel.h"
#include
"projectsubclip.h"
#include
"clipcreator.hpp"
#include
"timecode.h"
#include
"timeline2/model/snapmodel.hpp"
#include
"macros.hpp"
...
...
@@ -373,11 +374,17 @@ void ProjectClip::reloadProducer(bool refreshOnly, bool isProxy, bool forceAudio
// If another load job is running?
pCore
->
taskManager
.
discardJobs
({
ObjectType
::
BinClip
,
m_binId
.
toInt
()},
AbstractTask
::
LOADJOB
,
true
);
pCore
->
taskManager
.
discardJobs
({
ObjectType
::
BinClip
,
m_binId
.
toInt
()},
AbstractTask
::
CACHEJOB
);
if
(
QFile
::
exists
(
m_path
)
&&
(
!
isProxy
&&
!
hasProxy
()))
{
if
(
QFile
::
exists
(
m_path
)
&&
(
!
isProxy
&&
!
hasProxy
())
&&
m_properties
)
{
clearBackupProperties
();
}
QDomDocument
doc
;
QDomElement
xml
=
toXml
(
doc
);
QDomElement
xml
;
QString
resource
(
m_properties
->
get
(
"resource"
));
if
(
m_service
.
isEmpty
()
&&
!
resource
.
isEmpty
())
{
xml
=
ClipCreator
::
getXmlFromUrl
(
resource
).
documentElement
();
}
else
{
xml
=
toXml
(
doc
);
}
if
(
!
xml
.
isNull
())
{
bool
hashChanged
=
false
;
m_thumbsProducer
.
reset
();
...
...
@@ -1231,7 +1238,9 @@ void ProjectClip::setProperties(const QMap<QString, QString> &properties, bool r
}
else
if
(
!
properties
.
contains
(
"kdenlive:proxy"
))
{
// Clip resource changed, update thumbnail, name, clear hash
refreshOnly
=
false
;
getInfoForProducer
();
// Enforce reloading clip type in case of clip replacement
m_service
.
clear
();
m_clipType
=
ClipType
::
Unknown
;
updateRoles
<<
TimelineModel
::
ResourceRole
<<
TimelineModel
::
MaxDurationRole
<<
TimelineModel
::
NameRole
;
}
}
...
...
@@ -1342,7 +1351,7 @@ void ProjectClip::setProperties(const QMap<QString, QString> &properties, bool r
refreshPanel
=
true
;
}
}
if
(
refreshPanel
)
{
if
(
refreshPanel
&&
m_properties
)
{
// Some of the clip properties have changed through a command, update properties panel
emit
refreshPropertiesPanel
();
}
...
...
src/mltcontroller/clipcontroller.cpp
View file @
2981c558
...
...
@@ -324,7 +324,6 @@ QMap<QString, QString> ClipController::getPropertiesFromPrefix(const QString &pr
void
ClipController
::
updateProducer
(
const
std
::
shared_ptr
<
Mlt
::
Producer
>
&
producer
)
{
qDebug
()
<<
"################### ClipController::updateProducer"
;
// TODO replace all track producers
if
(
!
m_properties
)
{
// producer has not been initialized
return
addMasterProducer
(
producer
);
...
...
@@ -357,6 +356,9 @@ void ClipController::updateProducer(const std::shared_ptr<Mlt::Producer> &produc
setProducerProperty
(
QStringLiteral
(
"kdenlive:id"
),
m_controllerBinId
);
m_effectStack
->
resetService
(
m_masterProducer
);
emitProducerChanged
(
m_controllerBinId
,
producer
);
if
(
m_clipType
==
ClipType
::
Unknown
)
{
getInfoForProducer
();
}
// URL and name should 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()) {
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment