Fix invalid clips and project corruption on pasting sequence or project files with speed change (99f5c104) · Commits · Multimedia / Kdenlive · GitLab
Admin message
Join us at
Akademy
to celebrate KDE's 30th anniversary!
Travel support requests
are open till May 31st.
Register now
Verified
Commit
99f5c104
authored
Dec 04, 2025
by
Jean-Baptiste Mardelle
Browse files
parent
a1b0f78d
Loading
Loading
Loading
Loading
Changes
Pipelines
Loading
Original line number
Diff line number
Diff line
@@ -2556,6 +2556,14 @@ bool ProjectClip::isIncludedInTimeline()
return
m_registeredClipsByUuid
isEmpty
();
bool
ProjectClip
::
isIncludedInSequence
const
QUuid
seqUuid
if
m_registeredClipsByUuid
isEmpty
())
return
false
return
m_registeredClipsByUuid
contains
seqUuid
);
void
ProjectClip
::
replaceInTimeline
()
int
updatedDuration
m_resetTimelineOccurences
getFramePlaytime
()
Original line number
Diff line number
Diff line
@@ -221,6 +221,9 @@ public:
Note that this function does not account for children, use TreeItem::accumulate if you want to get that information as well.
*/
bool
isIncludedInTimeline
()
override
/** @brief Returns true if a clip corresponding to this bin is inserted in the timeline with UUid uuid.
*/
bool
isIncludedInSequence
const
QUuid
seqUuid
);
/** @brief Returns a list of all timeline clip ids for this bin clip */
QList
int
timelineInstances
QUuid
activeUuid
QUuid
())
const
QMap
QUuid
QList
int
>>
getAllTimelineInstances
()
const
Original line number
Diff line number
Diff line
@@ -70,7 +70,7 @@ QList
return
allChildren
QString
ProjectFolder
::
childByHash
const
QString
hash
QString
ProjectFolder
::
childByHash
const
QString
hash
const
QString
uuid
QList
std
::
shared_ptr
ProjectClip
>>
allChildren
for
int
childCount
();
++
@@ -82,7 +82,7 @@ QString ProjectFolder::childByHash(const QString &hash)
for
auto
clip
allChildren
if
clip
->
statusReady
()
&&
clip
->
hash
()
==
hash
if
((
uuid
isEmpty
()
&&
clip
->
getControlUuid
()
==
uuid
||
clip
->
statusReady
()
&&
clip
->
hash
()
==
hash
return
clip
->
clipId
();
Original line number
Diff line number
Diff line
@@ -72,5 +72,5 @@ public:
/** @brief Returns true if item has both audio and video enabled. */
bool
hasAudioAndVideo
()
const
override
/** @brief Returns a clip id if folder contains clip with matching at \@hash, empty if not found. */
QString
childByHash
const
QString
hash
);
QString
childByHash
const
QString
hash
const
QString
uuid
);
};
Original line number
Diff line number
Diff line
@@ -516,6 +516,33 @@ const QVector
return
{};
QStringList
ProjectItemModel
::
getAllSequenceBinIds
const
QUuid
uuid
QList
QUuid
processedUuids
READ_LOCK
();
QStringList
result
if
((
processedUuids
).
contains
uuid
))
return
result
processedUuids
<<
uuid
for
const
auto
clip
m_allItems
// auto c = std::static_pointer_cast
auto
std
::
static_pointer_cast
ProjectClip
clip
second
lock
());
if
&&
->
clipType
()
!=
ClipType
::
Timeline
if
->
isIncludedInSequence
uuid
))
result
push_back
->
clipId
());
else
const
QUuid
seqUuid
->
getSequenceUuid
();
if
processedUuids
).
contains
seqUuid
))
result
<<
getAllSequenceBinIds
seqUuid
processedUuids
);
processedUuids
<<
seqUuid
result
removeDuplicates
();
return
result
const
QVector
int16_t
ProjectItemModel
::
getAudioLevelsByBinID
const
QString
binId
int
stream
READ_LOCK
();
@@ -1603,7 +1630,7 @@ void ProjectItemModel::loadTractorPlaylist(Mlt::Tractor documentTractor, std::un
for
const
auto
clipLoop
m_allItems
auto
std
::
static_pointer_cast
AbstractProjectItem
clipLoop
second
lock
());
if
->
itemType
()
==
AbstractProjectItem
::
ClipItem
if
->
clipType
()
==
matchType
if
->
clipType
()
==
matchType
||
matchType
==
ClipType
::
Unknown
std
::
shared_ptr
ProjectClip
pClip
std
::
static_pointer_cast
ProjectClip
);
qDebug
()
<<
"::::::
\n
TRYING TO MATCH: "
<<
pClip
->
getProducerProperty
QStringLiteral
"resource"
))
<<
" = "
<<
resource
if
pClip
->
getProducerProperty
QStringLiteral
"kdenlive:file_hash"
))
==
hash
@@ -1613,6 +1640,10 @@ void ProjectItemModel::loadTractorPlaylist(Mlt::Tractor documentTractor, std::un
found
true
break
if
uuid
isEmpty
()
&&
pClip
->
getControlUuid
()
==
uuid
found
true
break
@@ -1944,12 +1975,12 @@ bool ProjectItemModel::validateClip(const QString &binId, const QString &clipHas
return
false
QString
ProjectItemModel
::
validateClipInFolder
const
QString
folderId
const
QString
clipHash
QString
ProjectItemModel
::
validateClipInFolder
const
QString
folderId
const
QString
clipHash
const
QString
clipUuid
QWriteLocker
locker
m_lock
);
std
::
shared_ptr
ProjectFolder
folder
getFolderByBinId
folderId
);
if
folder
return
folder
->
childByHash
clipHash
);
return
folder
->
childByHash
clipHash
clipUuid
);
return
QString
();
Loading
US