Fix subtitles (seen in DVB) which have a specified `to' time but
[dcpomatic.git] / src / lib / ffmpeg_subtitle_stream.cc
index 627b0fef1c8b61b6890397c97282f4d42f7700af..57c54e1eabaec21ea42b379dbc375e82d90bbcb6 100644 (file)
@@ -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);
+               }
+       }
+}