Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Fix composition duration calculation. Related to #395

parent 7c8a26e9
Pipeline #9439 failed with stage
in 2 minutes and 40 seconds
......@@ -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;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment