summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-02-07 21:38:01 +0000
committerCarl Hetherington <cth@carlh.net>2018-02-07 21:38:01 +0000
commitf964e99d63f5f5999ae4f245e6b25ced014d8383 (patch)
tree31262a83652d5e4b1b6d9460843873287208ad7c /src
parentf19fba719f1da6850ae320534c669196ea9d854c (diff)
db8af2f changed rebase() to round down when rebasing times, but
did not say why. This rounding down produces some unexpected results, e.g. taking 41 at a TCR of 1000 to a TCR of 24 gives 0, which upsets those who use DCP-o-matic and put in a SRT subtitle ending at ,041 --- the sub time is rounded down to 0 for a SMPTE DCP. This commit restores round-to-nearest behaviour.
Diffstat (limited to 'src')
-rw-r--r--src/dcp_time.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dcp_time.cc b/src/dcp_time.cc
index 50946f4c..f0b7e231 100644
--- a/src/dcp_time.cc
+++ b/src/dcp_time.cc
@@ -356,5 +356,5 @@ Time::as_seconds () const
Time
Time::rebase (int tcr_) const
{
- return Time (h, m, s, floor (float (e) * tcr_ / tcr), tcr_);
+ return Time (h, m, s, lrintf (float (e) * tcr_ / tcr), tcr_);
}