Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Multimedia
Kdenlive
Commits
ac506287
Commit
ac506287
authored
Feb 22, 2018
by
Nicolas Carion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix crash on undo clip insertion in case of audio split
parent
3f858c78
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
9 deletions
+21
-9
src/timeline2/model/timelinemodel.cpp
src/timeline2/model/timelinemodel.cpp
+21
-9
No files found.
src/timeline2/model/timelinemodel.cpp
View file @
ac506287
...
...
@@ -626,17 +626,29 @@ bool TimelineModel::requestClipInsertion(const QString &binClipId, int trackId,
pCore
->
displayMessage
(
i18n
(
"No available audio track for split operation"
),
ErrorMessage
);
res
=
false
;
}
else
{
std
::
function
<
bool
(
void
)
>
audio_undo
=
[]()
{
return
true
;
};
std
::
function
<
bool
(
void
)
>
audio_redo
=
[]()
{
return
true
;
};
int
newId
;
res
=
requestClipCreation
(
binClipId
,
newId
,
PlaylistState
::
AudioOnly
,
local_undo
,
local_redo
);
bool
move
=
false
;
while
(
!
move
&&
!
possibleTracks
.
isEmpty
())
{
int
newTrack
=
possibleTracks
.
takeFirst
();
move
=
requestClipMove
(
newId
,
newTrack
,
position
,
true
,
false
,
undo
,
redo
);
}
if
(
!
res
||
!
move
)
{
pCore
->
displayMessage
(
i18n
(
"Audio split failed"
),
ErrorMessage
);
res
=
requestClipCreation
(
binClipId
,
newId
,
PlaylistState
::
AudioOnly
,
audio_undo
,
audio_redo
);
if
(
res
)
{
bool
move
=
false
;
while
(
!
move
&&
!
possibleTracks
.
isEmpty
())
{
int
newTrack
=
possibleTracks
.
takeFirst
();
move
=
requestClipMove
(
newId
,
newTrack
,
position
,
true
,
false
,
audio_undo
,
audio_redo
);
}
// use lazy evaluation to group only if move was successful
res
=
res
&&
move
&&
requestClipsGroup
({
id
,
newId
},
audio_undo
,
audio_redo
,
GroupType
::
AVSplit
);
if
(
!
res
||
!
move
)
{
pCore
->
displayMessage
(
i18n
(
"Audio split failed: no viable track"
),
ErrorMessage
);
bool
undone
=
audio_undo
();
Q_ASSERT
(
undone
);
}
else
{
UPDATE_UNDO_REDO
(
audio_redo
,
audio_undo
,
local_undo
,
local_redo
);
}
}
else
{
requestClipsGroup
({
id
,
newId
},
local_undo
,
local_redo
,
GroupType
::
AVSplit
);
pCore
->
displayMessage
(
i18n
(
"Audio split failed: impossible to create audio clip"
),
ErrorMessage
);
bool
undone
=
audio_undo
();
Q_ASSERT
(
undone
);
}
}
}
...
...
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