(for example when trying to insert a clip at a negative time)
GenTime add(shift, m_document->fps());
ItemInfo start = clip->info();
- ItemInfo end = clip->info();
+ ItemInfo end = start;
end.startPos = m_audioAlignmentReference->info().startPos + add;
- end.endPos = m_audioAlignmentReference->info().startPos + add + clip->info().cropDuration;
+ end.endPos = end.startPos + start.cropDuration;
QUndoCommand *moveCommand = new QUndoCommand();
moveCommand->setText(i18n("Auto-align clip"));
trackPlaylist.insert_blank(clipIndex, clipProducer->get_playtime() - 1);
}
int newIndex = trackPlaylist.insert_at(moveEnd, clipProducer, 1);
+ if (newIndex == -1) {
+ kDebug()<<"// CANNOT MOVE CLIP TO: "<<moveEnd;
+ trackPlaylist.insert_at(moveStart, clipProducer, 1);
+ delete clipProducer;
+ service.unlock();
+ return false;
+ }
trackPlaylist.consolidate_blanks(1);
delete clipProducer;
/*if (QString(clipProducer.parent().get("transparency")).toInt() == 1) {