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
406a48b1
Commit
406a48b1
authored
Feb 25, 2022
by
Jean-Baptiste Mardelle
Browse files
Fix crash updating speed before/after in time remap
CCBUGS: #450324
parent
45c25b88
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/dialogs/timeremap.cpp
View file @
406a48b1
...
...
@@ -1126,10 +1126,10 @@ void RemapView::goPrev()
void
RemapView
::
updateBeforeSpeed
(
double
speed
)
{
QMutexLocker
lock
(
&
m_kfrMutex
);
QMap
<
int
,
int
>::
iterator
it
=
m_keyframes
.
f
ind
(
m_currentKeyframe
.
first
);
QMap
<
int
,
int
>::
const_
iterator
it
=
m_keyframes
.
constF
ind
(
m_currentKeyframe
.
first
);
QMap
<
int
,
int
>
updatedKfrs
;
QList
<
int
>
toDelete
;
if
(
*
it
!=
m_keyframes
.
first
()
&&
it
!=
m_keyframes
.
e
nd
())
{
if
(
*
it
!=
m_keyframes
.
first
()
&&
it
!=
m_keyframes
.
constE
nd
())
{
m_keyframesOrigin
=
m_keyframes
;
it
--
;
int
updatedLength
=
qFuzzyIsNull
(
speed
)
?
0
:
(
m_currentKeyframe
.
second
-
it
.
value
())
*
100.
/
speed
;
...
...
@@ -1140,11 +1140,11 @@ void RemapView::updateBeforeSpeed(double speed)
m_bottomPosition
=
m_currentKeyframe
.
first
;
m_selectedKeyframes
.
clear
();
m_selectedKeyframes
.
insert
(
m_currentKeyframe
.
first
,
m_currentKeyframe
.
second
);
it
++
;
it
=
m_keyframes
.
constFind
(
m_currentKeyframe
.
first
)
;
if
(
*
it
!=
m_keyframes
.
last
())
{
it
++
;
// Update all keyframes after that so that we don't alter the speeds
while
(
m_moveNext
&&
it
!=
m_keyframes
.
e
nd
())
{
while
(
m_moveNext
&&
it
!=
m_keyframes
.
constE
nd
())
{
toDelete
<<
it
.
key
();
updatedKfrs
.
insert
(
it
.
key
()
+
offset
,
it
.
value
());
it
++
;
...
...
@@ -1170,7 +1170,7 @@ void RemapView::updateBeforeSpeed(double speed)
void
RemapView
::
updateAfterSpeed
(
double
speed
)
{
QMutexLocker
lock
(
&
m_kfrMutex
);
QMap
<
int
,
int
>::
iterator
it
=
m_keyframes
.
f
ind
(
m_currentKeyframe
.
first
);
QMap
<
int
,
int
>::
const_
iterator
it
=
m_keyframes
.
constF
ind
(
m_currentKeyframe
.
first
);
if
(
*
it
!=
m_keyframes
.
last
())
{
m_keyframesOrigin
=
m_keyframes
;
it
++
;
...
...
@@ -1179,7 +1179,7 @@ void RemapView::updateAfterSpeed(double speed)
int
updatedLength
=
qFuzzyIsNull
(
speed
)
?
0
:
(
it
.
value
()
-
m_currentKeyframe
.
second
)
*
100.
/
speed
;
int
offset
=
m_currentKeyframe
.
first
+
updatedLength
-
it
.
key
();
if
(
m_moveNext
)
{
while
(
it
!=
m_keyframes
.
e
nd
())
{
while
(
it
!=
m_keyframes
.
constE
nd
())
{
toDelete
<<
it
.
key
();
updatedKfrs
.
insert
(
it
.
key
()
+
offset
,
it
.
value
());
it
++
;
...
...
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