diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-07-04 11:43:55 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-07-04 11:43:55 +0100 |
| commit | 9655db97eae5a6137a45ad809dbf42528dc74408 (patch) | |
| tree | 178ecd2e313ceb6aa7d11fbadb950c53381f1280 /src/lib/subrip_decoder.cc | |
| parent | c88a8a6ec6b396dc90d40a4843160d616a45db76 (diff) | |
Add 'starting' option to subtitles_during().
Diffstat (limited to 'src/lib/subrip_decoder.cc')
| -rw-r--r-- | src/lib/subrip_decoder.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/subrip_decoder.cc b/src/lib/subrip_decoder.cc index 370118d30..4bdf06e7c 100644 --- a/src/lib/subrip_decoder.cc +++ b/src/lib/subrip_decoder.cc @@ -80,14 +80,14 @@ SubRipDecoder::pass () } list<ContentTimePeriod> -SubRipDecoder::subtitles_during (ContentTimePeriod p) const +SubRipDecoder::subtitles_during (ContentTimePeriod p, bool starting) const { /* XXX: inefficient */ list<ContentTimePeriod> d; for (vector<SubRipSubtitle>::const_iterator i = _subtitles.begin(); i != _subtitles.end(); ++i) { - if (p.overlaps (i->period)) { + if ((starting && p.contains (i->period.from)) || (!starting && p.overlaps (i->period))) { d.push_back (i->period); } } |
