Increase maximum allowable KDM file size.
[dcpomatic.git] / src / lib / subtitle_decoder.cc
index 9ec030b383e6f8442afb8c20c98c8a3576b19a7a..ff6f4b9daeca44555a49e424f9d5ecc1a495d194 100644 (file)
@@ -63,6 +63,7 @@ void
 SubtitleDecoder::give_image (ContentTimePeriod period, shared_ptr<Image> image, dcpomatic::Rect<double> rect)
 {
        _decoded_image.push_back (ContentImageSubtitle (period, image, rect));
+       _position = period.from;
 }
 
 void
@@ -79,6 +80,7 @@ SubtitleDecoder::give_text (ContentTimePeriod period, list<dcp::SubtitleString>
        }
 
        _decoded_text.push_back (ContentTextSubtitle (period, s));
+       _position = period.to;
 }
 
 /** Get the subtitles that correspond to a given list of periods.
@@ -107,7 +109,12 @@ SubtitleDecoder::get (list<T> const & subs, list<ContentTimePeriod> const & sp,
 
        /* Suggest to our parent decoder that it might want to seek if we haven't got what we're being asked for */
        if (missing) {
-               _log->log (String::compose ("SD suggests seek to %1", to_string (*missing)), LogEntry::TYPE_DEBUG_DECODE);
+               _log->log (
+                       String::compose (
+                               "SD suggests seek to %1 from %2",
+                               to_string (*missing),
+                               position() ? to_string(*position()) : "nowhere"),
+                       LogEntry::TYPE_DEBUG_DECODE);
                maybe_seek (*missing, true);
        }
 
@@ -168,6 +175,7 @@ SubtitleDecoder::seek (ContentTime t, bool)
 {
        _log->log (String::compose ("SD seek to %1", to_string(t)), LogEntry::TYPE_DEBUG_DECODE);
        reset ();
+       _position.reset ();
 }
 
 void