diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-11-23 09:54:16 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-11-23 09:54:16 +0000 |
| commit | cd32ade6c276b9163a8aa889a9d81ead6ddb59d6 (patch) | |
| tree | 63af1edfaa43524129909e3eeaeec2aa2e1dec9d /src/lib/ffmpeg_subtitle_stream.cc | |
| parent | 827e9dac612368b0268f973ac59520b33c4f880f (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.cc | 17 |
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) |
