Fix crash on undo speed change

parent d75a00ba
Pipeline #13943 passed with stage
in 14 minutes and 19 seconds
......@@ -203,7 +203,7 @@ bool ClipModel::requestResize(int size, bool right, Fun &undo, Fun &redo, bool l
} else {
roles.push_back(TimelineModel::OutPointRole);
}
Fun operation = [this, inPoint, outPoint, roles, track_operation]() {
if (track_operation()) {
setInOut(inPoint, outPoint);
......@@ -512,9 +512,11 @@ Fun ClipModel::useTimewarpProducer_lambda(double speed)
return [speed, this]() {
qDebug() << "timeWarp producer" << speed;
refreshProducerFromBin(m_currentTrackId, m_currentState, speed);
if (auto ptr = m_parent.lock()) {
QModelIndex ix = ptr->makeClipIndexFromID(m_id);
ptr->notifyChange(ix, ix, TimelineModel::SpeedRole);
if (m_currentTrackId > -1) {
if (auto ptr = m_parent.lock()) {
QModelIndex ix = ptr->makeClipIndexFromID(m_id);
ptr->notifyChange(ix, ix, TimelineModel::SpeedRole);
}
}
return true;
};
......
......@@ -1904,7 +1904,7 @@ int TimelineModel::requestClipResizeAndTimeWarp(int itemId, int size, bool right
pos += getItemPlaytime(id) - size;
}
result = getTrackById(tid)->requestClipDeletion(id, true, true, undo, redo, false, true);
result = result && requestClipTimeWarp(id, speed, false, undo, redo);
result = result && requestClipTimeWarp(id, speed, true, undo, redo);
result = result && requestItemResize(id, size, true, true, undo, redo);
result = result && getTrackById(tid)->requestClipInsertion(id, pos, true, true, undo, redo);
if (!result) {
......
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