]> git.sesse.net Git - kdenlive/blobdiff - src/customtrackview.cpp
Fix timeline corruption when creating new project with fps != default fps
[kdenlive] / src / customtrackview.cpp
index 74afb07db2e0267c7d5191cb528c101cfa5e9e6f..b7cda93f09a83aed1f94e537cc4b39be3a801ebf 100644 (file)
@@ -373,6 +373,7 @@ void CustomTrackView::mouseMoveEvent(QMouseEvent * event)
 {
     int pos = event->x();
     int mappedXPos = qMax((int)(mapToScene(event->pos()).x() + 0.5), 0);
+   
     double snappedPos = getSnapPointForPos(mappedXPos);
     emit mousePosition(mappedXPos);
 
@@ -3056,7 +3057,7 @@ void CustomTrackView::setCursorPos(int pos, bool seek)
     if (pos == m_cursorPos) return;
     emit cursorMoved((int)(m_cursorPos), (int)(pos));
     m_cursorPos = pos;
-    if (seek) m_document->renderer()->seek(GenTime(m_cursorPos, m_document->fps()));
+    if (seek) m_document->renderer()->seek(m_cursorPos);
     else if (m_autoScroll) checkScrolling();
     m_cursorLine->setPos(m_cursorPos, 0);
 }
@@ -3077,7 +3078,7 @@ void CustomTrackView::moveCursorPos(int delta)
     emit cursorMoved((int)(m_cursorPos), (int)((m_cursorPos + delta)));
     m_cursorPos += delta;
     m_cursorLine->setPos(m_cursorPos, 0);
-    m_document->renderer()->seek(GenTime(m_cursorPos, m_document->fps()));
+    m_document->renderer()->seek(m_cursorPos);
 }
 
 void CustomTrackView::initCursorPos(int pos)
@@ -4057,7 +4058,7 @@ void CustomTrackView::slotUpdateClip(const QString &clipId, bool reload)
                 if (reload && !m_document->renderer()->mltUpdateClip(info, clip->xml(), clip->baseClip()->producer(info.track))) {
                     emit displayMessage(i18n("Cannot update clip (time: %1, track: %2)", info.startPos.frames(m_document->fps()), info.track), ErrorMessage);
                 }
-                clip->refreshClip(true);
+                clip->refreshClip(true, true);
             }
         }
     }
@@ -5599,7 +5600,7 @@ void CustomTrackView::slotUpdateAllThumbs()
                         item->slotSetEndThumb(pix);
                     }
                 }
-                item->refreshClip(false);
+                item->refreshClip(false, false);
             }
         }
     }
@@ -6618,7 +6619,7 @@ void CustomTrackView::updateTrackDuration(int track, QUndoCommand *command)
     }
 }
 
-void CustomTrackView::slotRefreshThumbs(const QString &id)
+void CustomTrackView::slotRefreshThumbs(const QString &id, bool resetThumbs)
 {
     QList<QGraphicsItem *> list = scene()->items();
     ClipItem *clip = NULL;
@@ -6626,7 +6627,7 @@ void CustomTrackView::slotRefreshThumbs(const QString &id)
         if (list.at(i)->type() == AVWIDGET) {
             clip = static_cast <ClipItem *>(list.at(i));
             if (clip->clipProducer() == id) {
-                clip->refreshClip(true);
+                clip->refreshClip(true, resetThumbs);
             }
         }
     }