summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_subtitle_stream.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-11-23 09:54:16 +0000
committerCarl Hetherington <cth@carlh.net>2016-11-23 09:54:16 +0000
commitcd32ade6c276b9163a8aa889a9d81ead6ddb59d6 (patch)
tree63af1edfaa43524129909e3eeaeec2aa2e1dec9d /src/lib/ffmpeg_subtitle_stream.cc
parent827e9dac612368b0268f973ac59520b33c4f880f (diff)
Fix hanging subtitles after recent changes to subtitle examination.
Diffstat (limited to 'src/lib/ffmpeg_subtitle_stream.cc')
-rw-r--r--src/lib/ffmpeg_subtitle_stream.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/lib/ffmpeg_subtitle_stream.cc b/src/lib/ffmpeg_subtitle_stream.cc
index 57c54e1ea..d389714e9 100644
--- a/src/lib/ffmpeg_subtitle_stream.cc
+++ b/src/lib/ffmpeg_subtitle_stream.cc
@@ -181,6 +181,23 @@ FFmpegSubtitleStream::find_subtitle_to (string id) const
return i->second.to;
}
+/** @param id Subtitle id.
+ * @return true if the `from' and `to' times for this id are equal, which indicates
+ * that the `to' time is unknown.
+ */
+bool
+FFmpegSubtitleStream::unknown_to (string id) const
+{
+ PeriodMap::const_iterator i = _image_subtitles.find (id);
+ if (i != _image_subtitles.end ()) {
+ return i->second.from == i->second.to;
+ }
+
+ i = _text_subtitles.find (id);
+ DCPOMATIC_ASSERT (i != _text_subtitles.end ());
+ return i->second.from == i->second.to;
+}
+
/** Add some offset to all the times in the stream */
void
FFmpegSubtitleStream::add_offset (ContentTime offset)