diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-06-12 23:34:31 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-06-12 23:34:31 +0100 |
| commit | 41d32a43f761fd2d79dacf9a84374a6d17916d36 (patch) | |
| tree | bf106bf5a6df144af38a93adc70adddf8ce2897b /src/lib/subtitle_decoder.cc | |
| parent | 141f9a795381fa3bbd3f2bcbd19975dfd8a8c35e (diff) | |
Fix subrip subtitles a little.
Diffstat (limited to 'src/lib/subtitle_decoder.cc')
| -rw-r--r-- | src/lib/subtitle_decoder.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/subtitle_decoder.cc b/src/lib/subtitle_decoder.cc index 13cf481c8..fc03442d5 100644 --- a/src/lib/subtitle_decoder.cc +++ b/src/lib/subtitle_decoder.cc @@ -51,7 +51,8 @@ template <class T> list<shared_ptr<T> > SubtitleDecoder::get (list<shared_ptr<T> > const & subs, ContentTimePeriod period) { - if (!_subtitle_content->has_subtitle_during (period)) { + if (!has_subtitle_during (period)) { + cout << "no subtitle during this period.\n"; return list<shared_ptr<T> > (); } @@ -71,7 +72,7 @@ SubtitleDecoder::get (list<shared_ptr<T> > const & subs, ContentTimePeriod perio list<shared_ptr<T> > out; for (typename list<shared_ptr<T> >::const_iterator i = subs.begin(); i != subs.end(); ++i) { - if ((*i)->period().from <= period.to && (*i)->period().to >= period.from) { + if ((*i)->period().overlaps (period)) { out.push_back (*i); } } |
