From 4e2e24a44857dd6dbd777cd28d851fd792ca3124 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 6 Jan 2014 11:44:07 +0000 Subject: [PATCH] Fix mis-timed subtitles with non-zero video PTS offsets. --- ChangeLog | 2 ++ src/lib/ffmpeg_decoder.cc | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 212847438..1e5c1a6ef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2014-01-06 Carl Hetherington + * Fix mis-timed subtitles when there is a non-zero video PTS offset. + * Remove seemingly unnecessary checks on image directories. * Leave DCP directory creation until the last minute to help diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index 5a1b78762..1546031b8 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -559,7 +559,7 @@ FFmpegDecoder::decode_subtitle_packet () /* 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 (sub.pts) / AV_TIME_BASE; + double const packet_time = (static_cast (sub.pts ) / AV_TIME_BASE) + _video_pts_offset; /* hence start time for this sub */ Time const from = (packet_time + (double (sub.start_display_time) / 1e3)) * TIME_HZ; -- 2.30.2