summaryrefslogtreecommitdiff
path: root/src/lib/subtitle.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-12-18 21:13:53 +0000
committerCarl Hetherington <cth@carlh.net>2012-12-18 21:13:53 +0000
commit602fd58eff38fdfccc489b9f77b3ff0ca0009566 (patch)
treef44645730c3b412fcc0c79f4bca73260567a362d /src/lib/subtitle.cc
parent039a55081427b1ff0026cd6b9ca787526d37ef92 (diff)
parent0330d9b2924767d9240c5a25e9ed4327eb0a73bd (diff)
Fix merge.
Diffstat (limited to 'src/lib/subtitle.cc')
-rw-r--r--src/lib/subtitle.cc11
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
{