changeset 262:a048066bd20f

correcting bug in framesToTime
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Wed, 25 Jul 2012 18:22:18 -0400
parents 4aa792cb0fa9
children c71540470057
files python/utils.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/python/utils.py	Wed Jul 25 18:02:36 2012 -0400
+++ b/python/utils.py	Wed Jul 25 18:22:18 2012 -0400
@@ -168,12 +168,12 @@
     'returns hour, minutes and seconds'
     from math import floor
     from datetime import time
-    seconds = int(floor(float(nFrames)/float(frameRate)))
+    seconds = int(floor(float(nFrames)/float(frameRate))+initialTime[0]*3600+initialTime[1]*60+initialTime[2])
     h = int(floor(seconds/3600.))
     seconds = seconds - h*3600
     m = int(floor(seconds/60))
     seconds = seconds - m*60
-    return time(h+int(initialTime[0]), m+int(initialTime[1]), seconds+int(initialTime[2]))
+    return time(h, m, seconds)
 
 def sortXY(X,Y):
     'returns the sorted (x, Y(x)) sorted on X'