From 4f902db0ad994910a34ca845225635ceefcac96e Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 31 Dec 2012 18:16:58 +0000 Subject: Initial hacks. --- src/dcp_time.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/dcp_time.cc') diff --git a/src/dcp_time.cc b/src/dcp_time.cc index c9cd751a..c5a7affd 100644 --- a/src/dcp_time.cc +++ b/src/dcp_time.cc @@ -39,9 +39,14 @@ Time::Time (int frame, int frames_per_second) , s (0) , t (0) { - float sec_float = float (frame) / frames_per_second; - t = (int (floor (sec_float * 1000)) % 1000) / 4; - s = floor (sec_float); + set (double (frame) / frames_per_second); +} + +void +Time::set (double ss) +{ + t = (int (round (ss * 1000)) % 1000) / 4; + s = floor (ss); if (s > 60) { m = s / 60; -- cgit v1.2.3