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

time remap: fix expanding clip creating extra keyframes

parent dfc4097e
...@@ -215,18 +215,11 @@ void RemapView::setDuration(std::shared_ptr<Mlt::Producer> service, int duration ...@@ -215,18 +215,11 @@ void RemapView::setDuration(std::shared_ptr<Mlt::Producer> service, int duration
if (lastPos > lastKeyframePos) { if (lastPos > lastKeyframePos) {
keyframeAdded = true; keyframeAdded = true;
std::pair<double,double>speeds = getSpeed({lastKeyframePos,lastKeyframeValue}); std::pair<double,double>speeds = getSpeed({lastKeyframePos,lastKeyframeValue});
if (lastKeyframePos == m_inFrame + m_duration - 1) {
// Move last keyframe // Move last keyframe
//TODO: check we still have a keyframe at it pos
it--; it--;
int updatedVal = it.value() + ((lastPos - it.key()) * speeds.first); int updatedVal = it.value() + ((lastPos - it.key()) * speeds.first);
m_keyframes.remove(lastKeyframePos); m_keyframes.remove(lastKeyframePos);
m_keyframes.insert(lastPos, updatedVal); m_keyframes.insert(lastPos, updatedVal);
} else {
// Add a keyframe at end
int updatedVal = it.value() + (lastPos - it.key());
m_keyframes.insert(lastPos, updatedVal);
}
} }
} else if (duration < m_duration) { } else if (duration < m_duration) {
keyframeAdded = true; 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