From c8ff422a42eac30517a7acde57ab84e55449f4e4 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 26 Jun 2015 22:02:00 +0100 Subject: Fix missing subtitles in some cases. We were passing subtitles back from decoders to SubtitleDecoder using dcp::SubtitleStrings and relying on their storage of time to know when the subtitles were. These times are quantised (by the use of dcp::SubtitleString) and then compared with unquantised times (kept as ContentTime) in the main checking loop in SubtitleDecoder::get(). Fix this by storing periods as ContentTimePeriod as well as in the dcp::SubtitleStrings. --- src/lib/subtitle_decoder.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/lib/subtitle_decoder.cc') diff --git a/src/lib/subtitle_decoder.cc b/src/lib/subtitle_decoder.cc index dd2558505..d20196a63 100644 --- a/src/lib/subtitle_decoder.cc +++ b/src/lib/subtitle_decoder.cc @@ -17,9 +17,10 @@ */ -#include #include "subtitle_decoder.h" #include "subtitle_content.h" +#include +#include using std::list; using std::cout; @@ -46,9 +47,9 @@ SubtitleDecoder::image_subtitle (ContentTimePeriod period, shared_ptr ima } void -SubtitleDecoder::text_subtitle (list s) +SubtitleDecoder::text_subtitle (ContentTimePeriod period, list s) { - _decoded_text_subtitles.push_back (ContentTextSubtitle (s)); + _decoded_text_subtitles.push_back (ContentTextSubtitle (period, s)); } /** @param sp Full periods of subtitles that are showing or starting during the specified period */ -- cgit v1.2.3