- }
-
- _decoded_text.push_back (ContentTextSubtitle (period, s));
- _position = period.from;
-}
-
-/** Get the subtitles that correspond to a given list of periods.
- * @param subs Subtitles.
- * @param sp Periods for which to extract subtitles from subs.
- */
-template <class T>
-list<T>
-SubtitleDecoder::get (list<T> const & subs, list<ContentTimePeriod> const & sp, ContentTimePeriod period, bool accurate)
-{
- if (sp.empty ()) {
- return list<T> ();
- }
-
- /* Find the time of the first subtitle we don't have in subs */
- optional<ContentTime> missing;
- BOOST_FOREACH (ContentTimePeriod i, sp) {
- typename list<T>::const_iterator j = subs.begin();
- while (j != subs.end() && j->period() != i) {
- ++j;
- }
- if (j == subs.end ()) {
- missing = i.from;
- }
- }
-
- /* 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);
- maybe_seek (*missing, true);
- }