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
39d2567a
Commit
39d2567a
authored
Oct 25, 2019
by
Jean-Baptiste Mardelle
Browse files
Small fixes to composition duration calculation
parent
3c655ca4
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/timeline2/view/timelinecontroller.cpp
View file @
39d2567a
...
...
@@ -364,8 +364,10 @@ int TimelineController::insertNewComposition(int tid, int clipId, int offset, co
int
minimum
=
m_model
->
getClipPosition
(
clipId
);
int
clip_duration
=
m_model
->
getClipPlaytime
(
clipId
);
int
position
=
minimum
;
bool
adjustOffset
=
false
;
if
(
offset
>
clip_duration
/
2
)
{
position
+=
offset
;
adjustOffset
=
true
;
}
else
{
// Check if we have a composition at beginning
std
::
unordered_set
<
int
>
existing
=
m_model
->
getTrackById_const
(
tid
)
->
getCompositionsInRange
(
minimum
,
minimum
+
offset
);
...
...
@@ -394,9 +396,12 @@ int TimelineController::insertNewComposition(int tid, int clipId, int offset, co
}
else
if
(
position
>
bottom
.
first
)
{
int
test_duration
=
m_model
->
getTrackById_const
(
lowerVideoTrackId
)
->
suggestCompositionLength
(
position
);
if
(
test_duration
>
0
)
{
duration
=
test_duration
;
duration
=
qMin
(
test_duration
,
clip_duration
)
;
}
}
}
else
if
(
!
adjustOffset
)
{
// No clip below, keep original drop position
position
+=
offset
;
}
int
duration2
=
m_model
->
getTrackById_const
(
lowerVideoTrackId
)
->
suggestCompositionLength
(
position
);
if
(
duration2
>
0
)
{
...
...
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