Fix corruption and freeze on razor undo

CCBUG: 357054
parent d0a38e91
......@@ -2595,7 +2595,6 @@ ClipItem *CustomTrackView::cutClip(const ItemInfo &info, const GenTime &cutTime,
return dup;
} else {
// uncut clip
ClipItem *item = getClipItemAtStart(info.startPos, info.track);
ClipItem *dup = getClipItemAtStart(cutTime, info.track);
......@@ -2603,6 +2602,7 @@ ClipItem *CustomTrackView::cutClip(const ItemInfo &info, const GenTime &cutTime,
emit displayMessage(i18n("Cannot find clip to uncut"), ErrorMessage);
return NULL;
}
if (!m_timeline->track(info.track)->del(cutTime.seconds())) {
emit displayMessage(i18n("Error removing clip at %1 on track %2", m_document->timecode().getTimecodeFromFrames(cutTime.frames(m_document->fps())), m_timeline->getTrackInfo(info.track).trackName), ErrorMessage);
return NULL;
......@@ -2624,7 +2624,7 @@ ClipItem *CustomTrackView::cutClip(const ItemInfo &info, const GenTime &cutTime,
dup = NULL;
ItemInfo clipinfo = item->info();
bool success = m_timeline->track(clipinfo.track)->resize(clipinfo.startPos.seconds(), (info.endPos - info.startPos).seconds(), true);
bool success = m_timeline->track(clipinfo.track)->resize(clipinfo.startPos.seconds(), (info.endPos - cutTime).seconds(), true);
if (success) {
item->resizeEnd((int) info.endPos.frames(m_document->fps()));
item->setEffectList(oldStack);
......
......@@ -283,7 +283,7 @@ int Timeline::getTracks() {
getEffects(playlist, NULL, i);
slotUpdateTrackEffectState(i);
}
connect(tk, &Track::newTrackDuration, this, &Timeline::checkDuration);
connect(tk, &Track::newTrackDuration, this, &Timeline::checkDuration, Qt::DirectConnection);
connect(tk, SIGNAL(storeSlowMotion(QString,Mlt::Producer *)), m_doc->renderer(), SLOT(storeSlowmotionProducer(QString,Mlt::Producer *)));
}
}
......
......@@ -191,6 +191,7 @@ bool Track::resize(qreal t, qreal dt, bool end)
QScopedPointer<Mlt::Producer> clip(m_playlist.get_clip(index));
if (clip == NULL || clip->is_blank()) {
qWarning("Can't resize clip at %f", t);
m_playlist.unlock();
return false;
}
......@@ -241,6 +242,7 @@ bool Track::resize(qreal t, qreal dt, bool end)
}
}
}
m_playlist.consolidate_blanks();
m_playlist.unlock();
return 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