summaryrefslogtreecommitdiff
path: root/src/lib/subtitle.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-12-18 21:13:10 +0000
committerCarl Hetherington <cth@carlh.net>2012-12-18 21:13:10 +0000
commit0330d9b2924767d9240c5a25e9ed4327eb0a73bd (patch)
treec0041d4d64b6cc6b1dc57fd12e23b5ca552197c1 /src/lib/subtitle.cc
parent880719c0bf2f2ce99ca44a5f5289fdd30962246a (diff)
Try to tidy up subtitle timing and seeks wrt source frames, DCP frames and rounding.
Diffstat (limited to 'src/lib/subtitle.cc')
-rw-r--r--src/lib/subtitle.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/subtitle.cc b/src/lib/subtitle.cc
index 1af277255..182e30ed3 100644
--- a/src/lib/subtitle.cc
+++ b/src/lib/subtitle.cc
@@ -39,7 +39,7 @@ TimedSubtitle::TimedSubtitle (AVSubtitle const & sub)
/* Subtitle PTS in seconds (within the source, not taking into account any of the
source that we may have chopped off for the DCP)
*/
- double const packet_time = ((sub.pts / AV_TIME_BASE) + float (sub.pts % AV_TIME_BASE) / 1e6);
+ double const packet_time = static_cast<double> (sub.pts) / AV_TIME_BASE;
/* hence start time for this sub */
_from = packet_time + (double (sub.start_display_time) / 1e3);
@@ -77,7 +77,7 @@ TimedSubtitle::TimedSubtitle (AVSubtitle const & sub)
_subtitle.reset (new Subtitle (Position (rect->x, rect->y), image));
}
-/** @param t Time in seconds from the start of the film */
+/** @param t Time in seconds from the start of the source */
bool
TimedSubtitle::displayed_at (double t) const
{