Skip to content
GitLab
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
01c81aff
Commit
01c81aff
authored
Mar 17, 2020
by
Jean-Baptiste Mardelle
Browse files
Fix crashes in expand clip.
Related to
#300
parent
f1fec81b
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/jobs/cachejob.cpp
View file @
01c81aff
...
...
@@ -49,8 +49,6 @@ CacheJob::CacheJob(const QString &binId, int thumbsCount, int inPoint, int outPo
m_fullWidth
++
;
}
m_imageHeight
+=
m_imageHeight
%
2
;
auto
item
=
pCore
->
projectItemModel
()
->
getItemByBinId
(
binId
);
Q_ASSERT
(
item
!=
nullptr
&&
item
->
itemType
()
==
AbstractProjectItem
::
ClipItem
);
connect
(
this
,
&
CacheJob
::
jobCanceled
,
[
&
]
()
{
m_done
=
true
;
m_clipId
.
clear
();
...
...
src/timeline2/model/timelinefunctions.cpp
View file @
01c81aff
...
...
@@ -1319,6 +1319,11 @@ bool TimelineFunctions::pasteClips(const std::shared_ptr<TimelineItemModel> &tim
}
videoTracks
<<
atrackPos
;
}
if
(
audioTracks
.
isEmpty
()
&&
videoTracks
.
isEmpty
())
{
// playlist does not have any tracks, exit
semaphore
.
release
(
1
);
return
true
;
}
// Now we have a list of all source tracks, check that we have enough target tracks
std
::
sort
(
videoTracks
.
begin
(),
videoTracks
.
end
());
std
::
sort
(
audioTracks
.
begin
(),
audioTracks
.
end
());
...
...
src/timeline2/view/timelinecontroller.cpp
View file @
01c81aff
...
...
@@ -2989,22 +2989,24 @@ void TimelineController::expandActiveClip()
if
(
m_model
->
isGroup
(
i
))
{
std
::
unordered_set
<
int
>
children
=
m_model
->
m_groups
->
getLeaves
(
i
);
items_list
.
insert
(
children
.
begin
(),
children
.
end
());
m_model
->
requestClipUngroup
(
i
,
undo
,
redo
);
}
else
{
items_list
.
insert
(
i
);
}
}
m_model
->
requestClearSelection
();
bool
result
=
true
;
int
processed
=
0
;
for
(
int
id
:
items_list
)
{
/*if (mainId == -1 && m_model->getItemTrackId(id) == m_activeTrack) {
mainId = id;
continue;
}*/
if
(
result
&&
m_model
->
isClip
(
id
))
{
std
::
shared_ptr
<
ClipModel
>
clip
=
m_model
->
getClipPtr
(
id
);
if
(
clip
->
clipType
()
==
ClipType
::
Playlist
)
{
int
pos
=
clip
->
getPosition
();
if
(
m_model
->
m_groups
->
isInGroup
(
id
))
{
int
targetRoot
=
m_model
->
m_groups
->
getRootId
(
id
);
if
(
m_model
->
isGroup
(
targetRoot
))
{
m_model
->
requestClipUngroup
(
targetRoot
,
undo
,
redo
);
}
}
QDomDocument
doc
=
TimelineFunctions
::
extractClip
(
m_model
,
id
,
getClipBinId
(
id
));
m_model
->
requestClipDeletion
(
id
,
undo
,
redo
);
result
=
TimelineFunctions
::
pasteClips
(
m_model
,
doc
.
toString
(),
m_activeTrack
,
pos
,
undo
,
redo
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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