]> git.sesse.net Git - kdenlive/commitdiff
fix fps issues
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Sun, 10 Jan 2010 18:47:37 +0000 (18:47 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Sun, 10 Jan 2010 18:47:37 +0000 (18:47 +0000)
svn path=/trunk/kdenlive/; revision=4222

src/smallruler.cpp
src/timecode.cpp

index f138b972c5e11275439720f9d4fc484b78e4e27b..c7e0ec1765e6524ae909ce4c317615d1f3ae9742 100644 (file)
@@ -123,10 +123,10 @@ void SmallRuler::mouseMoveEvent(QMouseEvent * event)
 
 bool SmallRuler::slotNewValue(int value)
 {
+    if (value == m_cursorFramePosition) return false;
     m_cursorFramePosition = value;
     int oldPos = m_cursorPosition;
     m_cursorPosition = value * m_scale;
-    if (oldPos == m_cursorPosition) return false;
     const int offset = 6;
     const int x = qMin(oldPos, m_cursorPosition);
     const int w = qAbs(oldPos - m_cursorPosition);
index 3c364d7308b48fbb3c7061a38c03f0d434075024..12f5bff3bf0c00ffbaf3b8dcfa31253f3d16460c 100644 (file)
@@ -102,7 +102,7 @@ const QString Timecode::getTimecodeFromFrames(int frames) const
 QString Timecode::getStringTimecode(int frames, const double &fps)
 {
     // Returns the timecode in an hh:mm:ss format
-    int seconds = frames / (int) floor(fps + 0.5);
+    int seconds = (int) (frames / fps);
     int minutes = seconds / 60;
     seconds = seconds % 60;
     int hours = minutes / 60;
@@ -121,9 +121,9 @@ QString Timecode::getStringTimecode(int frames, const double &fps)
 QString Timecode::getEasyTimecode(const GenTime & time, const double &fps)
 {
     // Returns the timecode in an easily read display, like 3 min. 5 sec.
-    int frames = (int)time.frames(fps);
-    int seconds = frames / (int) floor(fps + 0.5);
-    frames = frames % ((int) fps);
+    int frames = (int) time.frames(fps);
+    int seconds = (int) (frames / fps);
+    frames = frames - ((int) (fps * seconds));
 
     int minutes = seconds / 60;
     seconds = seconds % 60;