diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-07-02 18:10:58 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-07-02 18:10:58 +0100 |
| commit | c88a8a6ec6b396dc90d40a4843160d616a45db76 (patch) | |
| tree | b58c18fdb6c7946446ae244747fa7b4461fd9661 /src/lib/subrip_decoder.cc | |
| parent | 712f8144f1992364d79a80b2b586248423f7ac11 (diff) | |
Hopefully improve subtitle decoder seeking etc.
Diffstat (limited to 'src/lib/subrip_decoder.cc')
| -rw-r--r-- | src/lib/subrip_decoder.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/subrip_decoder.cc b/src/lib/subrip_decoder.cc index 3d971fd4b..370118d30 100644 --- a/src/lib/subrip_decoder.cc +++ b/src/lib/subrip_decoder.cc @@ -79,16 +79,18 @@ SubRipDecoder::pass () return false; } -bool -SubRipDecoder::has_subtitle_during (ContentTimePeriod p) const +list<ContentTimePeriod> +SubRipDecoder::subtitles_during (ContentTimePeriod p) const { /* XXX: inefficient */ + list<ContentTimePeriod> d; + for (vector<SubRipSubtitle>::const_iterator i = _subtitles.begin(); i != _subtitles.end(); ++i) { if (p.overlaps (i->period)) { - return true; + d.push_back (i->period); } } - return false; + return d; } |
