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
9cf41f26
Commit
9cf41f26
authored
Jan 24, 2020
by
Jean-Baptiste Mardelle
Browse files
Fix index corruption on track deletion.
Maybe related to "invalid red track warning"
CCBUG: 416677
parent
32919a82
Pipeline
#13759
passed with stage
in 17 minutes and 38 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/timeline2/model/timelinemodel.cpp
View file @
9cf41f26
...
...
@@ -2425,11 +2425,16 @@ Fun TimelineModel::deregisterTrack_lambda(int id)
emit
checkTrackDeletion
(
id
);
auto
it
=
m_iteratorTable
[
id
];
// iterator to the element
int
index
=
getTrackPosition
(
id
);
// compute index in list
m_tractor
->
remove_track
(
static_cast
<
int
>
(
index
+
1
));
// melt operation, add 1 to account for black background track
// send update to the model
m_allTracks
.
erase
(
it
);
// actual deletion of object
m_iteratorTable
.
erase
(
id
);
// clean table
beginRemoveRows
(
QModelIndex
(),
index
,
index
);
// melt operation, add 1 to account for black background track
m_tractor
->
remove_track
(
static_cast
<
int
>
(
index
+
1
));
// actual deletion of object
m_allTracks
.
erase
(
it
);
// clean table
m_iteratorTable
.
erase
(
id
);
// Finish operation
endRemoveRows
();
int
cache
=
(
int
)
QThread
::
idealThreadCount
()
+
((
int
)
m_allTracks
.
size
()
+
1
)
*
2
;
mlt_service_cache_set_size
(
NULL
,
"producer_avformat"
,
qMax
(
4
,
cache
));
...
...
src/timeline2/view/timelinecontroller.cpp
View file @
9cf41f26
...
...
@@ -608,6 +608,7 @@ void TimelineController::checkTrackDeletion(int selectedTrackIx)
if
(
m_activeTrack
==
selectedTrackIx
)
{
// Make sure we don't keep an index on a deleted track
m_activeTrack
=
-
1
;
emit
activeTrackChanged
();
}
if
(
m_model
->
m_audioTarget
==
selectedTrackIx
)
{
setAudioTarget
(
-
1
);
...
...
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