summaryrefslogtreecommitdiff
path: root/src/dcp_time.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/dcp_time.cc')
-rw-r--r--src/dcp_time.cc11
1 files changed, 8 insertions, 3 deletions
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;