Merge master.
[dcpomatic.git] / src / lib / subtitle_decoder.cc
index 13cf481c8027f70e0b468235ef0736cf47278570..786199e31a681d47db0f3b27cd9efad00de13208 100644 (file)
@@ -51,7 +51,7 @@ 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)) {
                return list<shared_ptr<T> > ();
        }
 
@@ -71,7 +71,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);
                }
        }