diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-12-31 18:16:58 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-12-31 18:16:58 +0000 |
| commit | 4f902db0ad994910a34ca845225635ceefcac96e (patch) | |
| tree | adf80a8543c20082057f7ed1e75b46524257b2e1 /src/dcp_time.cc | |
| parent | e651d843c513e8dbf0967735ea702a3795ac321d (diff) | |
Initial hacks.
Diffstat (limited to 'src/dcp_time.cc')
| -rw-r--r-- | src/dcp_time.cc | 11 |
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; |
