diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-12-14 10:54:51 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-12-14 10:54:51 +0000 |
| commit | f66e31b0cb9eff372ae943864d41e0ad0ee88daf (patch) | |
| tree | 2619ef01d4f5cae4a78ddb1e2e75881366029d48 /src/lib/subtitle_decoder.cc | |
| parent | 564780ded57e506f82971e71679a5645223bcff2 (diff) | |
Fix missing subtitle when a frame is re-fetched.
Before this we would get a subtitle at t, which would set the subtitle
decoder position to t. Then a second request for this sub would result
in no seek but the decoder would not re-produce the sub.
Diffstat (limited to 'src/lib/subtitle_decoder.cc')
| -rw-r--r-- | src/lib/subtitle_decoder.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/subtitle_decoder.cc b/src/lib/subtitle_decoder.cc index c59406c36..ff6f4b9da 100644 --- a/src/lib/subtitle_decoder.cc +++ b/src/lib/subtitle_decoder.cc @@ -80,7 +80,7 @@ SubtitleDecoder::give_text (ContentTimePeriod period, list<dcp::SubtitleString> } _decoded_text.push_back (ContentTextSubtitle (period, s)); - _position = period.from; + _position = period.to; } /** Get the subtitles that correspond to a given list of periods. @@ -109,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); } |
