From 4337694dfd488e88f56b63898ad35ce8ce9bb3c3 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 20 Nov 2016 22:08:11 +0000 Subject: Fix subtitles (seen in DVB) which have a specified `to' time but then are terminated earlier than that by a num_rects=0 subtitle. --- src/lib/ffmpeg_subtitle_stream.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/lib/ffmpeg_subtitle_stream.cc') diff --git a/src/lib/ffmpeg_subtitle_stream.cc b/src/lib/ffmpeg_subtitle_stream.cc index 627b0fef1..57c54e1ea 100644 --- a/src/lib/ffmpeg_subtitle_stream.cc +++ b/src/lib/ffmpeg_subtitle_stream.cc @@ -219,3 +219,19 @@ FFmpegSubtitleStream::has_image () const { return !_image_subtitles.empty (); } + +void +FFmpegSubtitleStream::set_subtitle_to (string id, ContentTime to) +{ + PeriodMap::iterator i = _image_subtitles.find (id); + if (i != _image_subtitles.end ()) { + i->second.to = to; + } else { + i = _text_subtitles.find (id); + if (i != _text_subtitles.end ()) { + i->second.to = to; + } else { + DCPOMATIC_ASSERT (false); + } + } +} -- cgit v1.2.3