diff options
Diffstat (limited to 'src/lib/subtitle.cc')
| -rw-r--r-- | src/lib/subtitle.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/subtitle.cc b/src/lib/subtitle.cc index 39f8faa68..c52d3ac66 100644 --- a/src/lib/subtitle.cc +++ b/src/lib/subtitle.cc @@ -31,14 +31,15 @@ using namespace boost; /** Construct a TimedSubtitle. This is a subtitle image, position, * and a range of time over which it should be shown. * @param sub AVSubtitle to read. - * @param c Fractional seconds that should be subtracted from the AVSubtitle's PTS. */ -TimedSubtitle::TimedSubtitle (AVSubtitle const & sub, double c) +TimedSubtitle::TimedSubtitle (AVSubtitle const & sub) { assert (sub.rects > 0); - /* subtitle PTS in seconds */ - double const packet_time = ((sub.pts / AV_TIME_BASE) + float (sub.pts % AV_TIME_BASE) / 1e6) - c; + /* 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 = static_cast<double> (sub.pts) / AV_TIME_BASE; /* hence start time for this sub */ _from = packet_time + (double (sub.start_display_time) / 1e3); @@ -76,7 +77,7 @@ TimedSubtitle::TimedSubtitle (AVSubtitle const & sub, double c) _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 { |
