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
0c2a2eae
Commit
0c2a2eae
authored
Jan 01, 2021
by
Jean-Baptiste Mardelle
Browse files
Fix crash if the clip of an audio align job is deleted during calculations
Related to
#900
parent
8c53fd0f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/timeline2/view/timelinecontroller.cpp
View file @
0c2a2eae
...
...
@@ -2482,10 +2482,13 @@ void TimelineController::setAudioRef(int clipId)
std
::
unique_ptr
<
AudioEnvelope
>
envelope
(
new
AudioEnvelope
(
getClipBinId
(
clipId
),
clipId
));
m_audioCorrelator
.
reset
(
new
AudioCorrelation
(
std
::
move
(
envelope
)));
connect
(
m_audioCorrelator
.
get
(),
&
AudioCorrelation
::
gotAudioAlignData
,
this
,
[
&
](
int
cid
,
int
shift
)
{
int
pos
=
m_model
->
getClipPosition
(
m_audioRef
)
+
shift
-
m_model
->
getClipIn
(
m_audioRef
);
bool
result
=
m_model
->
requestClipMove
(
cid
,
m_model
->
getClipTrackId
(
cid
),
pos
,
true
,
true
,
true
);
if
(
!
result
)
{
pCore
->
displayMessage
(
i18n
(
"Cannot move clip to frame %1."
,
(
pos
+
shift
)),
InformationMessage
,
500
);
// Ensure the clip was not deleted while processing calculations
if
(
m_model
->
isClip
(
cid
))
{
int
pos
=
m_model
->
getClipPosition
(
m_audioRef
)
+
shift
-
m_model
->
getClipIn
(
m_audioRef
);
bool
result
=
m_model
->
requestClipMove
(
cid
,
m_model
->
getClipTrackId
(
cid
),
pos
,
true
,
true
,
true
);
if
(
!
result
)
{
pCore
->
displayMessage
(
i18n
(
"Cannot move clip to frame %1."
,
(
pos
+
shift
)),
InformationMessage
,
500
);
}
}
});
connect
(
m_audioCorrelator
.
get
(),
&
AudioCorrelation
::
displayMessage
,
pCore
.
get
(),
&
Core
::
displayMessage
);
...
...
Write
Preview
Markdown
is supported
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