]> git.sesse.net Git - kdenlive/blobdiff - src/timecode.cpp
Fix incredibly broken timecode stuff(sometimes giving random values)
[kdenlive] / src / timecode.cpp
index 0e1fee55cd40c1a3e1e7fb093006505bf65616f3..ca51d7cf54422505429ad2620da7a09eb3f90c6a 100644 (file)
@@ -145,7 +145,6 @@ int Timecode::getFrameCount(const QString &duration) const
     if (duration.isEmpty()) {
         return 0;
     }
-
     int hours, minutes, seconds, frames;
     int offset = 0;
     if (duration.at(0) == '-') {
@@ -166,7 +165,7 @@ int Timecode::getFrameCount(const QString &duration) const
         int frameNumber = ((m_displayedFramesPerSecond * 3600 * hours) + (m_displayedFramesPerSecond * 60 * minutes) + (m_displayedFramesPerSecond * seconds) + frames) - (m_dropFrames * (totalMinutes - floor(totalMinutes / 10)));
         return frameNumber;
     }
-    return (int)(hours * 3600.0 + minutes * 60.0 + seconds * m_realFps + frames);
+    return (int)((hours * 3600.0 + minutes * 60.0 + seconds) * m_realFps + frames);
 }
 
 QString Timecode::getDisplayTimecode(const GenTime & time, bool frameDisplay) const