From 24d54ea7fe1ba128cf8d3521d6738fc73a7c623e Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 22 May 2014 16:53:38 +0100 Subject: Basics of noting subtitle times in FFmpegSubtitleStreams. --- src/lib/ffmpeg_decoder.cc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/lib/ffmpeg_decoder.cc') diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index 7d152e490..d668deb6f 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -62,6 +62,7 @@ using dcp::Size; FFmpegDecoder::FFmpegDecoder (shared_ptr c, shared_ptr log) : VideoDecoder (c) , AudioDecoder (c) + , SubtitleDecoder (c) , FFmpeg (c) , _log (log) , _subtitle_codec_context (0) @@ -516,12 +517,7 @@ FFmpegDecoder::decode_subtitle_packet () /* Subtitle PTS (within the source, not taking into account any of the source that we may have chopped off for the DCP) */ - ContentTime packet_time = ContentTime::from_seconds (static_cast (sub.pts) / AV_TIME_BASE) + _pts_offset; - - ContentTimePeriod period ( - packet_time + ContentTime::from_seconds (sub.start_display_time / 1e3), - packet_time + ContentTime::from_seconds (sub.end_display_time / 1e3) - ); + ContentTimePeriod period = subtitle_period (sub) + _pts_offset; AVSubtitleRect const * rect = sub.rects[0]; -- cgit v1.2.3