Merge branch '1.0' of ssh://main.carlh.net/home/carl/git/libdcp into 1.0
[libdcp.git] / src / dcp_time.cc
index 19ab2de105857c1414b5f486ea4823db9d078a31..4e7ab6f2fa0cac106c840dbebc45ed093e1a34b2 100644 (file)
@@ -38,14 +38,14 @@ Time::Time (int frame, int frames_per_second, int tcr_)
        set (double (frame) / frames_per_second, tcr_);
 }
 
-/** Construct a Time with a timecode rate of 24 and using the supplied
- *  number of seconds.
+/** Construct a Time from a number of seconds and a timecode rate.
  *
  *  @param seconds A number of seconds.
+ *  @param tcr_ Timecode rate.
  */
-Time::Time (double seconds)
+Time::Time (double seconds, int tcr_)
 {
-       set (seconds, 24);
+       set (seconds, tcr_);
 }
 
 /** Construct a Time with specified timecode rate and using the supplied
@@ -291,5 +291,5 @@ Time::as_seconds () const
 Time
 Time::rebase (int tcr_) const
 {
-       return Time (h, m, s, rint (float (e) * tcr_ / tcr), tcr_);
+       return Time (h, m, s, floor (float (e) * tcr_ / tcr), tcr_);
 }