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
a7651105
Commit
a7651105
authored
May 29, 2020
by
Jean-Baptiste Mardelle
Browse files
Fix possible crash when dragging recently inserted clip in timeline.
Related to
#698
parent
2e577702
Pipeline
#21680
passed with stage
in 11 minutes and 31 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/bin/projectclip.cpp
View file @
a7651105
...
...
@@ -494,6 +494,7 @@ bool ProjectClip::setProducer(std::shared_ptr<Mlt::Producer> producer, bool repl
}
}
pCore
->
bin
()
->
reloadMonitorIfActive
(
clipId
());
pCore
->
bin
()
->
updateTargets
(
clipId
());
for
(
auto
&
p
:
m_audioProducers
)
{
m_effectStack
->
removeService
(
p
.
second
);
}
...
...
src/timeline2/model/timelinemodel.cpp
View file @
a7651105
...
...
@@ -1111,13 +1111,16 @@ bool TimelineModel::requestClipInsertion(const QString &binClipId, int trackId,
trackId
=
audioTrackIds
.
at
(
audioTrackIds
.
count
()
-
keys
.
count
());
}
}
if
(
keys
.
isEmpty
())
{
return
false
;
}
audioStream
=
keys
.
first
();
}
else
{
// Dropping video, ensure we have enough audio tracks for its streams
int
mirror
=
getMirrorTrackId
(
trackId
);
QList
<
int
>
audioTids
=
getLowerTracksId
(
mirror
,
TrackType
::
AudioTrack
);
if
(
audioTids
.
count
()
<
keys
.
count
()
-
1
)
{
// C
H
eck if p
t
oject has enough audio tracks
// C
h
eck if p
r
oject has enough audio tracks
if
(
keys
.
count
()
>
getTracksIds
(
true
).
count
())
{
// Not enough audio tracks in the project
pCore
->
displayMessage
(
i18n
(
"Not enough audio tracks for all streams (%1)"
,
keys
.
count
()),
ErrorMessage
);
...
...
@@ -1152,7 +1155,7 @@ bool TimelineModel::requestClipInsertion(const QString &binClipId, int trackId,
if
(
mirror
>
-
1
&&
getTrackById_const
(
mirror
)
->
isLocked
())
{
mirror
=
-
1
;
}
bool
canMirrorDrop
=
!
useTargets
&&
(
mirror
>
-
1
||
keys
.
count
()
>
1
);
bool
canMirrorDrop
=
!
useTargets
&&
(
(
mirror
>
-
1
&&
(
audioDrop
||
!
keys
.
isEmpty
()))
||
keys
.
count
()
>
1
);
QMap
<
int
,
int
>
dropTargets
;
if
(
res
&&
(
canMirrorDrop
||
!
target_track
.
isEmpty
())
&&
master
->
hasAudioAndVideo
())
{
int
streamsCount
=
0
;
...
...
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