From cd5cd0e424def236f30fe6231eb21a06e3287d8a Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Sat, 3 Oct 2009 12:28:22 +0000 Subject: [PATCH] Fix broken handling of clips with speed effect svn path=/trunk/kdenlive/; revision=3983 --- src/abstractclipitem.cpp | 17 ++++++---------- src/abstractclipitem.h | 4 ++-- src/changespeedcommand.cpp | 7 ++++--- src/changespeedcommand.h | 3 ++- src/clipitem.cpp | 41 ++++++++++++++++++++++++++++---------- src/clipitem.h | 11 +++++----- src/customtrackview.cpp | 30 ++++++++++++---------------- src/customtrackview.h | 2 +- src/definitions.h | 6 ++---- src/renderer.cpp | 13 ++++++------ src/renderer.h | 2 +- src/trackview.cpp | 3 +-- 12 files changed, 75 insertions(+), 64 deletions(-) diff --git a/src/abstractclipitem.cpp b/src/abstractclipitem.cpp index 0e422865..983d3077 100644 --- a/src/abstractclipitem.cpp +++ b/src/abstractclipitem.cpp @@ -85,7 +85,7 @@ void AbstractClipItem::updateRectGeometry() setRect(0, 0, cropDuration().frames(m_fps) - 0.02, rect().height()); } -void AbstractClipItem::resizeStart(int posx, double speed) +void AbstractClipItem::resizeStart(int posx) { GenTime durationDiff = GenTime(posx, m_fps) - m_info.startPos; if (durationDiff == GenTime()) return; @@ -100,27 +100,22 @@ void AbstractClipItem::resizeStart(int posx, double speed) } //kDebug()<<"// DURATION DIFF: "< GenTime()) { @@ -167,7 +162,7 @@ void AbstractClipItem::resizeEnd(int posx, double speed) kDebug() << "///////// CURRENT: " << startPos().frames(25) << "x" << endPos().frames(25) << ", RECT: " << rect() << "-" << pos(); kDebug() << "///////// COLLISION: " << ((AbstractClipItem *)item)->startPos().frames(25) << "x" << ((AbstractClipItem *)item)->endPos().frames(25) << ", RECT: " << ((AbstractClipItem *)item)->rect() << "-" << item->pos();*/ GenTime diff = ((AbstractClipItem *)item)->startPos() - GenTime(1, m_fps) - startPos(); - m_info.cropDuration = GenTime((int)(diff.frames(m_fps) * speed), m_fps); + m_info.cropDuration = diff; setRect(0, 0, cropDuration().frames(m_fps) - 0.02, rect().height()); break; } diff --git a/src/abstractclipitem.h b/src/abstractclipitem.h index 79072ea5..eb07f21e 100644 --- a/src/abstractclipitem.h +++ b/src/abstractclipitem.h @@ -54,8 +54,8 @@ public: virtual int track() const ; virtual GenTime cropStart() const ; virtual GenTime cropDuration() const ; - virtual void resizeStart(int posx, double speed = 1.0); - virtual void resizeEnd(int posx, double speed = 1.0); + virtual void resizeStart(int posx); + virtual void resizeEnd(int posx); virtual double fps() const; virtual void updateFps(double fps); virtual GenTime maxDuration() const; diff --git a/src/changespeedcommand.cpp b/src/changespeedcommand.cpp index db488077..f775c681 100644 --- a/src/changespeedcommand.cpp +++ b/src/changespeedcommand.cpp @@ -23,10 +23,11 @@ #include -ChangeSpeedCommand::ChangeSpeedCommand(CustomTrackView *view, ItemInfo info, double old_speed, double new_speed, int old_strobe, int new_strobe, const QString &clipId, QUndoCommand * parent) : +ChangeSpeedCommand::ChangeSpeedCommand(CustomTrackView *view, ItemInfo info, ItemInfo speedIndependantInfo, double old_speed, double new_speed, int old_strobe, int new_strobe, const QString &clipId, QUndoCommand * parent) : QUndoCommand(parent), m_view(view), m_clipInfo(info), + m_speedIndependantInfo(speedIndependantInfo), m_clipId(clipId), m_old_speed(old_speed), m_new_speed(new_speed), @@ -40,12 +41,12 @@ ChangeSpeedCommand::ChangeSpeedCommand(CustomTrackView *view, ItemInfo info, dou // virtual void ChangeSpeedCommand::undo() { - m_view->doChangeClipSpeed(m_clipInfo, m_old_speed, m_new_speed, m_old_strobe, m_clipId); + m_view->doChangeClipSpeed(m_clipInfo, m_speedIndependantInfo, m_old_speed, m_new_speed, m_old_strobe, m_clipId); } // virtual void ChangeSpeedCommand::redo() { - m_view->doChangeClipSpeed(m_clipInfo, m_new_speed, m_old_speed, m_new_strobe, m_clipId); + m_view->doChangeClipSpeed(m_clipInfo, m_speedIndependantInfo, m_new_speed, m_old_speed, m_new_strobe, m_clipId); } diff --git a/src/changespeedcommand.h b/src/changespeedcommand.h index 3f54c8fb..8adb5fc5 100644 --- a/src/changespeedcommand.h +++ b/src/changespeedcommand.h @@ -33,13 +33,14 @@ class CustomTrackView; class ChangeSpeedCommand : public QUndoCommand { public: - ChangeSpeedCommand(CustomTrackView *view, ItemInfo info, double old_speed, double new_speed, int old_strobe, int new_strobe, const QString &clipId, QUndoCommand * parent = 0); + ChangeSpeedCommand(CustomTrackView *view, ItemInfo info, ItemInfo speedIndependantInfo, double old_speed, double new_speed, int old_strobe, int new_strobe, const QString &clipId, QUndoCommand * parent = 0); virtual void undo(); virtual void redo(); private: CustomTrackView *m_view; ItemInfo m_clipInfo; + ItemInfo m_speedIndependantInfo; QString m_clipId; double m_old_speed; double m_new_speed; diff --git a/src/clipitem.cpp b/src/clipitem.cpp index 4ae0514a..efb4c00c 100644 --- a/src/clipitem.cpp +++ b/src/clipitem.cpp @@ -59,6 +59,12 @@ ClipItem::ClipItem(DocClipBase *clip, ItemInfo info, double fps, double speed, i setZValue(2); setRect(0, 0, (info.endPos - info.startPos).frames(fps) - 0.02, (double)(KdenliveSettings::trackheight() - 2)); setPos(info.startPos.frames(fps), (double)(info.track * KdenliveSettings::trackheight()) + 1); + + // set speed independant info + m_speedIndependantInfo = m_info; + m_speedIndependantInfo.cropStart = GenTime((int)(m_info.cropStart.frames(m_fps) * m_speed), m_fps); + m_speedIndependantInfo.cropDuration = GenTime((int)(m_info.cropDuration.frames(m_fps) * m_speed), m_fps); + m_videoPix = KIcon("kdenlive-show-video").pixmap(QSize(16, 16)); m_audioPix = KIcon("kdenlive-show-audio").pixmap(QSize(16, 16)); @@ -1074,13 +1080,19 @@ void ClipItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *) } */ -void ClipItem::resizeStart(int posx, double /*speed*/) +void ClipItem::resizeStart(int posx) { const int min = (startPos() - cropStart()).frames(m_fps); if (posx < min) posx = min; if (posx == startPos().frames(m_fps)) return; const int previous = cropStart().frames(m_fps); - AbstractClipItem::resizeStart(posx, m_speed); + AbstractClipItem::resizeStart(posx); + + // set speed independant info + m_speedIndependantInfo = m_info; + m_speedIndependantInfo.cropStart = GenTime((int)(m_info.cropStart.frames(m_fps) * m_speed), m_fps); + m_speedIndependantInfo.cropDuration = GenTime((int)(m_info.cropDuration.frames(m_fps) * m_speed), m_fps); + if ((int) cropStart().frames(m_fps) != previous) { if (m_hasThumbs && KdenliveSettings::videothumbnails()) { /*connect(m_clip->thumbProducer(), SIGNAL(thumbReady(int, QPixmap)), this, SLOT(slotThumbReady(int, QPixmap)));*/ @@ -1089,14 +1101,20 @@ void ClipItem::resizeStart(int posx, double /*speed*/) } } -void ClipItem::resizeEnd(int posx, double /*speed*/) +void ClipItem::resizeEnd(int posx) { const int max = (startPos() - cropStart() + maxDuration()).frames(m_fps); if (posx > max && maxDuration() != GenTime()) posx = max; if (posx == endPos().frames(m_fps)) return; //kDebug() << "// NEW POS: " << posx << ", OLD END: " << endPos().frames(m_fps); const int previous = cropDuration().frames(m_fps); - AbstractClipItem::resizeEnd(posx, m_speed); + AbstractClipItem::resizeEnd(posx); + + // set speed independant info + m_speedIndependantInfo = m_info; + m_speedIndependantInfo.cropStart = GenTime((int)(m_info.cropStart.frames(m_fps) * m_speed), m_fps); + m_speedIndependantInfo.cropDuration = GenTime((int)(m_info.cropDuration.frames(m_fps) * m_speed), m_fps); + if ((int) cropDuration().frames(m_fps) != previous) { if (m_hasThumbs && KdenliveSettings::videothumbnails()) { /*connect(m_clip->thumbProducer(), SIGNAL(thumbReady(int, QPixmap)), this, SLOT(slotThumbReady(int, QPixmap)));*/ @@ -1493,6 +1511,8 @@ void ClipItem::setSpeed(const double speed, const int strobe) m_strobe = strobe; if (m_speed == 1.0) m_clipName = baseClip()->name(); else m_clipName = baseClip()->name() + " - " + QString::number(speed * 100, 'f', 0) + '%'; + m_info.cropStart = GenTime((int)(m_speedIndependantInfo.cropStart.frames(m_fps) / m_speed + 0.5), m_fps); + m_info.cropDuration = GenTime((int)(m_speedIndependantInfo.cropDuration.frames(m_fps) / m_speed + 0.5), m_fps); //update(); } @@ -1501,19 +1521,20 @@ GenTime ClipItem::maxDuration() const return GenTime((int)(m_maxDuration.frames(m_fps) / m_speed + 0.5), m_fps); } -GenTime ClipItem::cropStart() const +GenTime ClipItem::speedIndependantCropStart() const { - return GenTime((int)(m_info.originalcropStart.frames(m_fps) / m_speed + 0.5), m_fps); + return m_speedIndependantInfo.cropStart; } -GenTime ClipItem::cropDuration() const +GenTime ClipItem::speedIndependantCropDuration() const { - return GenTime((int)(m_info.cropDuration.frames(m_fps) / m_speed + 0.5), m_fps); + return m_speedIndependantInfo.cropDuration; } -GenTime ClipItem::endPos() const + +const ItemInfo ClipItem::speedIndependantInfo() const { - return m_info.startPos + cropDuration(); + return m_speedIndependantInfo; } //virtual diff --git a/src/clipitem.h b/src/clipitem.h index 56bbd77a..70b1aee6 100644 --- a/src/clipitem.h +++ b/src/clipitem.h @@ -47,8 +47,8 @@ public: const QStyleOptionGraphicsItem *option, QWidget *); virtual int type() const; - void resizeStart(int posx, double speed = 1.0); - void resizeEnd(int posx, double speed = 1.0); + void resizeStart(int posx); + void resizeEnd(int posx); OPERATIONTYPE operationMode(QPointF pos); const QString clipProducer() const; int clipType() const; @@ -101,9 +101,9 @@ public: double speed() const; int strobe() const; GenTime maxDuration() const; - GenTime cropStart() const; - GenTime endPos() const; - GenTime cropDuration() const; + GenTime speedIndependantCropStart() const; + GenTime speedIndependantCropDuration() const; + const ItemInfo speedIndependantInfo() const; int hasEffect(const QString &tag, const QString &id) const; bool checkKeyFrames(); QPixmap startThumb() const; @@ -126,6 +126,7 @@ protected: private: DocClipBase *m_clip; + ItemInfo m_speedIndependantInfo; QString m_producer; CLIPTYPE m_clipType; QString m_clipName; diff --git a/src/customtrackview.cpp b/src/customtrackview.cpp index 51887871..8ea76bc2 100644 --- a/src/customtrackview.cpp +++ b/src/customtrackview.cpp @@ -1270,7 +1270,6 @@ bool CustomTrackView::insertDropClips(const QMimeData *data, const QPoint pos) info.cropStart = GenTime(list.at(1).toInt(), m_document->fps()); info.endPos = GenTime(list.at(2).toInt() - list.at(1).toInt(), m_document->fps()); info.cropDuration = info.endPos - info.startPos; - info.originalcropStart = info.cropStart; info.track = 0; // Check if clip can be inserted at that position @@ -1406,11 +1405,10 @@ void CustomTrackView::addEffect(int track, GenTime pos, QDomElement effect) emit displayMessage(i18n("Problem adding effect to clip"), ErrorMessage); return; } - ItemInfo info = clip->info(); double speed = EffectsList::parameter(effect, "speed").toDouble() / 100.0; int strobe = EffectsList::parameter(effect, "strobe").toInt(); if (strobe == 0) strobe = 1; - doChangeClipSpeed(info, speed, 1.0, strobe, clip->baseClip()->getId()); + doChangeClipSpeed(clip->info(), clip->speedIndependantInfo(), speed, 1.0, strobe, clip->baseClip()->getId()); EffectsParameterList params = clip->addEffect(effect); m_document->renderer()->mltAddEffect(track, pos, params); if (clip->isSelected()) emit clipItemSelected(clip); @@ -1435,8 +1433,7 @@ void CustomTrackView::deleteEffect(int track, GenTime pos, QDomElement effect) if (effect.attribute("id") == "speed") { ClipItem *clip = getClipItemAt((int)pos.frames(m_document->fps()), m_document->tracksCount() - track); if (clip) { - ItemInfo info = clip->info(); - doChangeClipSpeed(info, 1.0, clip->speed(), 1, clip->baseClip()->getId()); + doChangeClipSpeed(clip->info(), clip->speedIndependantInfo(), 1.0, clip->speed(), 1, clip->baseClip()->getId()); clip->deleteEffect(index); emit clipItemSelected(clip); m_document->renderer()->mltRemoveEffect(track, pos, index, true); @@ -1571,13 +1568,12 @@ void CustomTrackView::updateEffect(int track, GenTime pos, QDomElement insertedE if (clip) { // Special case: speed effect if (effect.attribute("id") == "speed") { - ItemInfo info = clip->info(); - if (effect.attribute("disabled") == "1") doChangeClipSpeed(info, 1.0, clip->speed(), 1, clip->baseClip()->getId()); + if (effect.attribute("disabled") == "1") doChangeClipSpeed(clip->info(), clip->speedIndependantInfo(), 1.0, clip->speed(), 1, clip->baseClip()->getId()); else { double speed = EffectsList::parameter(effect, "speed").toDouble() / 100.0; int strobe = EffectsList::parameter(effect, "strobe").toInt(); if (strobe == 0) strobe = 1; - doChangeClipSpeed(info, speed, clip->speed(), strobe, clip->baseClip()->getId()); + doChangeClipSpeed(clip->info(), clip->speedIndependantInfo(), speed, clip->speed(), strobe, clip->baseClip()->getId()); } clip->setEffectAt(ix, effect); if (ix == clip->selectedEffectIndex()) { @@ -1692,8 +1688,7 @@ void CustomTrackView::cutClip(ItemInfo info, GenTime cutTime, bool cut) newPos.endPos = info.endPos; newPos.cropStart = item->info().cropStart + (cutTime - info.startPos); newPos.track = info.track; - newPos.cropDuration = GenTime((int)((newPos.endPos - newPos.startPos).frames(m_document->fps()) * speed), m_document->fps()); - newPos.originalcropStart = GenTime((int)(newPos.cropStart .frames(m_document->fps()) * speed), m_document->fps()); + newPos.cropDuration = newPos.endPos - newPos.startPos; ClipItem *dup = item->clone(newPos); @@ -1708,7 +1703,7 @@ void CustomTrackView::cutClip(ItemInfo info, GenTime cutTime, bool cut) QDomElement oldeffect = item->effectAt(ix); dup->deleteEffect(oldeffect.attribute("kdenlive_ix")); } - item->resizeEnd(cutPos, false); + item->resizeEnd(cutPos); scene()->addItem(dup); if (item->checkKeyFrames()) slotRefreshEffects(item); if (dup->checkKeyFrames()) slotRefreshEffects(dup); @@ -3205,7 +3200,7 @@ void CustomTrackView::changeClipSpeed() else delete changeSelected; } -void CustomTrackView::doChangeClipSpeed(ItemInfo info, const double speed, const double oldspeed, int strobe, const QString &id) +void CustomTrackView::doChangeClipSpeed(ItemInfo info, ItemInfo speedIndependantInfo, const double speed, const double oldspeed, int strobe, const QString &id) { DocClipBase *baseclip = m_document->clipManager()->getClipById(id); ClipItem *item = getClipItemAt((int) info.startPos.frames(m_document->fps()), info.track); @@ -3215,12 +3210,13 @@ void CustomTrackView::doChangeClipSpeed(ItemInfo info, const double speed, const return; } info.track = m_document->tracksCount() - item->track(); - int endPos = m_document->renderer()->mltChangeClipSpeed(info, speed, oldspeed, strobe, baseclip->producer()); + int endPos = m_document->renderer()->mltChangeClipSpeed(info, speedIndependantInfo, speed, oldspeed, strobe, baseclip->producer()); if (endPos >= 0) { item->setSpeed(speed, strobe); item->updateRectGeometry(); - if (item->cropDuration().frames(m_document->fps()) > endPos) - item->AbstractClipItem::resizeEnd(info.startPos.frames(m_document->fps()) + endPos, speed); + if (item->cropDuration().frames(m_document->fps()) != endPos) { + item->resizeEnd((int) info.startPos.frames(m_document->fps()) + endPos - 1); + } updatePositionEffects(item, info); setDocumentModified(); } else emit displayMessage(i18n("Invalid clip"), ErrorMessage); @@ -4507,7 +4503,7 @@ void CustomTrackView::setOutPoint() ItemInfo startInfo = clip->info(); ItemInfo endInfo = clip->info(); endInfo.endPos = GenTime(m_cursorPos, m_document->fps()); - CLIPTYPE type = (CLIPTYPE) static_cast (clip)->clipType(); + CLIPTYPE type = (CLIPTYPE) static_cast (clip)->clipType(); if (endInfo.endPos <= startInfo.startPos || (type != IMAGE && type != COLOR && type != TEXT && endInfo.endPos > startInfo.startPos + clip->maxDuration() - startInfo.cropStart)) { // Check for invalid resize emit displayMessage(i18n("Invalid action"), ErrorMessage); @@ -4515,7 +4511,7 @@ void CustomTrackView::setOutPoint() } else if (endInfo.endPos > startInfo.endPos) { int length = m_document->renderer()->mltGetSpaceLength(startInfo.endPos, m_document->tracksCount() - startInfo.track, false); if ((clip->type() == TRANSITIONWIDGET && itemCollision(clip, endInfo) == true) || (clip->type() == AVWIDGET && length != -1 && length < (endInfo.endPos - startInfo.endPos).frames(m_document->fps()))) { - kDebug()<<" RESIZE ERROR, BLNK: "<fps()); + kDebug() << " RESIZE ERROR, BLNK: " << length << ", RESIZE: " << (endInfo.endPos - startInfo.endPos).frames(m_document->fps()); emit displayMessage(i18n("Invalid action"), ErrorMessage); return; } diff --git a/src/customtrackview.h b/src/customtrackview.h index e62b15d7..2e1633f0 100644 --- a/src/customtrackview.h +++ b/src/customtrackview.h @@ -96,7 +96,7 @@ public: void clipStart(); void clipEnd(); void changeClipSpeed(); - void doChangeClipSpeed(ItemInfo info, const double speed, const double oldspeed, int strobe, const QString &id); + void doChangeClipSpeed(ItemInfo info, ItemInfo speedIndependantInfo, const double speed, const double oldspeed, int strobe, const QString &id); void setDocumentModified(); void setInPoint(); void setOutPoint(); diff --git a/src/definitions.h b/src/definitions.h index 57f67c70..7b72a88a 100644 --- a/src/definitions.h +++ b/src/definitions.h @@ -66,11 +66,9 @@ struct ItemInfo { GenTime startPos; /** endPos is the duration where the clip ends on the track */ GenTime endPos; - /** originalcropStart is the position where the sub-clip starts, relative to the clip's 0 position. Doe not depend on speed */ - GenTime originalcropStart; - /** cropStart is the position where the sub-clip starts, depend on effects (speed,...) */ + /** cropStart is the position where the sub-clip starts, relative to the clip's 0 position */ GenTime cropStart; - /** cropDuration is the duration of the clip, does not depend on speed */ + /** cropDuration is the duration of the clip */ GenTime cropDuration; int track; }; diff --git a/src/renderer.cpp b/src/renderer.cpp index 93d2a2b8..908472ed 100644 --- a/src/renderer.cpp +++ b/src/renderer.cpp @@ -1991,7 +1991,7 @@ void Render::mltPasteEffects(Mlt::Producer *source, Mlt::Producer *dest) } } -int Render::mltChangeClipSpeed(ItemInfo info, double speed, double oldspeed, int strobe, Mlt::Producer *prod) +int Render::mltChangeClipSpeed(ItemInfo info, ItemInfo speedIndependantInfo, double speed, double oldspeed, int strobe, Mlt::Producer *prod) { m_isBlocked = true; int newLength = 0; @@ -2077,12 +2077,11 @@ int Render::mltChangeClipSpeed(ItemInfo info, double speed, double oldspeed, int int blankEnd = trackPlaylist.clip_start(clipIndex) + trackPlaylist.clip_length(clipIndex); Mlt::Producer *cut; - GenTime duration = info.cropDuration; - int originalStart = (int)(info.originalcropStart.frames(m_fps)); - if (clipIndex + 1 < trackPlaylist.count() && (info.startPos + info.cropDuration).frames(m_fps) > blankEnd) { + int originalStart = (int)(speedIndependantInfo.cropStart.frames(m_fps)); + if (clipIndex + 1 < trackPlaylist.count() && (info.startPos + speedIndependantInfo.cropDuration).frames(m_fps) > blankEnd) { GenTime maxLength = GenTime(blankEnd, m_fps) - info.startPos; cut = prod->cut(originalStart, (int)(originalStart + maxLength.frames(m_fps) - 1)); - } else cut = prod->cut(originalStart, (int)(originalStart + info.cropDuration.frames(m_fps)) - 1); + } else cut = prod->cut(originalStart, (int)(originalStart + speedIndependantInfo.cropDuration.frames(m_fps)) - 1); // move all effects to the correct producer mltPasteEffects(clip, cut); @@ -2116,8 +2115,8 @@ int Render::mltChangeClipSpeed(ItemInfo info, double speed, double oldspeed, int Mlt::Producer *clip = trackPlaylist.replace_with_blank(clipIndex); trackPlaylist.consolidate_blanks(0); - GenTime duration = info.cropDuration / speed; - int originalStart = (int)(info.originalcropStart.frames(m_fps) / speed); + GenTime duration = speedIndependantInfo.cropDuration / speed; + int originalStart = (int)(speedIndependantInfo.cropStart.frames(m_fps) / speed); // Check that the blank space is long enough for our new duration clipIndex = trackPlaylist.get_clip_index_at(startPos); diff --git a/src/renderer.h b/src/renderer.h index c4d683ef..c7d308ea 100644 --- a/src/renderer.h +++ b/src/renderer.h @@ -211,7 +211,7 @@ Q_OBJECT public: to the clip and 0.6 is the speed in percents. The newly created producer will have it's "id" parameter set to: "slowmotion:parentid:speed", where parentid is the id of the original clip in the ClipManager list and speed is the current speed */ - int mltChangeClipSpeed(ItemInfo info, double speed, double oldspeed, int strobe, Mlt::Producer *prod); + int mltChangeClipSpeed(ItemInfo info, ItemInfo speedIndependantInfo, double speed, double oldspeed, int strobe, Mlt::Producer *prod); const QList producersList(); void updatePreviewSettings(); diff --git a/src/trackview.cpp b/src/trackview.cpp index c18b1678..5d852ec5 100644 --- a/src/trackview.cpp +++ b/src/trackview.cpp @@ -570,8 +570,7 @@ int TrackView::slotAddProjectTrack(int ix, QDomElement xml, bool locked) clipinfo.startPos = GenTime(position, m_doc->fps()); clipinfo.endPos = clipinfo.startPos + GenTime(out - in + 1, m_doc->fps()); clipinfo.cropStart = GenTime(in, m_doc->fps()); - clipinfo.cropDuration = GenTime((int)((clipinfo.endPos - clipinfo.startPos).frames(m_doc->fps()) * speed + 0.5), m_doc->fps()); - clipinfo.originalcropStart = GenTime((int)((clipinfo.cropStart).frames(m_doc->fps()) * speed + 0.5), m_doc->fps()); + clipinfo.cropDuration = clipinfo.endPos - clipinfo.startPos; clipinfo.track = ix; //kDebug() << "// INSERTING CLIP: " << in << "x" << out << ", track: " << ix << ", ID: " << id << ", SCALE: " << m_scale << ", FPS: " << m_doc->fps(); -- 2.39.2