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
3c655ca4
Commit
3c655ca4
authored
Oct 25, 2019
by
Jean-Baptiste Mardelle
Browse files
Fix composition duration calculation. Related to #395
parent
7c8a26e9
Pipeline
#9439
failed with stage
in 2 minutes and 40 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/timeline2/view/timelinecontroller.cpp
View file @
3c655ca4
...
...
@@ -381,12 +381,20 @@ int TimelineController::insertNewComposition(int tid, int clipId, int offset, co
int
bottomId
=
m_model
->
getTrackById_const
(
lowerVideoTrackId
)
->
getClipByPosition
(
position
);
if
(
bottomId
>
0
)
{
QPair
<
int
,
int
>
bottom
(
m_model
->
m_allClips
[
bottomId
]
->
getPosition
(),
m_model
->
m_allClips
[
bottomId
]
->
getPlaytime
());
if
(
bottom
.
first
>
minimum
&&
position
>
bottom
.
first
)
{
int
test_duration
=
m_model
->
getTrackById_const
(
tid
)
->
suggestCompositionLength
(
bottom
.
first
);
if
(
bottom
.
first
>
minimum
)
{
// Lower clip is after top clip
if
(
position
>
bottom
.
first
)
{
int
test_duration
=
m_model
->
getTrackById_const
(
tid
)
->
suggestCompositionLength
(
bottom
.
first
);
if
(
test_duration
>
0
)
{
position
=
bottom
.
first
;
duration
=
test_duration
;
revert
=
position
>
minimum
;
}
}
}
else
if
(
position
>
bottom
.
first
)
{
int
test_duration
=
m_model
->
getTrackById_const
(
lowerVideoTrackId
)
->
suggestCompositionLength
(
position
);
if
(
test_duration
>
0
)
{
position
=
bottom
.
first
;
duration
=
test_duration
;
revert
=
position
>
minimum
;
}
}
}
...
...
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