Commit e1bad5d5 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Merge branch '2108'

parents ae0e52af 511997cb
Pipeline #71654 passed with stage
in 8 minutes and 10 seconds
......@@ -215,18 +215,11 @@ void RemapView::setDuration(std::shared_ptr<Mlt::Producer> service, int duration
if (lastPos > lastKeyframePos) {
keyframeAdded = true;
std::pair<double,double>speeds = getSpeed({lastKeyframePos,lastKeyframeValue});
if (lastKeyframePos == m_inFrame + m_duration - 1) {
// Move last keyframe
//TODO: check we still have a keyframe at it pos
it--;
int updatedVal = it.value() + ((lastPos - it.key()) * speeds.first);
m_keyframes.remove(lastKeyframePos);
m_keyframes.insert(lastPos, updatedVal);
} else {
// Add a keyframe at end
int updatedVal = it.value() + (lastPos - it.key());
m_keyframes.insert(lastPos, updatedVal);
}
// Move last keyframe
it--;
int updatedVal = it.value() + ((lastPos - it.key()) * speeds.first);
m_keyframes.remove(lastKeyframePos);
m_keyframes.insert(lastPos, updatedVal);
}
} else if (duration < m_duration) {
keyframeAdded = true;
......
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