X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fdcp_subtitle_decoder.cc;h=3c7bffdda440295cdc8033bb943922b6e5ba743b;hb=e60bb3e51bd1508b149e6b8f6608f09b5196ae26;hp=236e999969e243e9ac5eae4f062348d050d78111;hpb=2bfd531137f1a4874493186015046e33c5a07c1e;p=dcpomatic.git diff --git a/src/lib/dcp_subtitle_decoder.cc b/src/lib/dcp_subtitle_decoder.cc index 236e99996..3c7bffdda 100644 --- a/src/lib/dcp_subtitle_decoder.cc +++ b/src/lib/dcp_subtitle_decoder.cc @@ -19,7 +19,7 @@ #include "dcp_subtitle_decoder.h" #include "dcp_subtitle_content.h" -#include +#include using std::list; using std::cout; @@ -28,7 +28,7 @@ using boost::shared_ptr; DCPSubtitleDecoder::DCPSubtitleDecoder (shared_ptr content) : SubtitleDecoder (content) { - shared_ptr c (load (content->path (0))); + shared_ptr c (load (content->path (0))); _subtitles = c->subtitles (); _next = _subtitles.begin (); } @@ -40,7 +40,7 @@ DCPSubtitleDecoder::seek (ContentTime time, bool accurate) _next = _subtitles.begin (); list::const_iterator i = _subtitles.begin (); - while (i != _subtitles.end() && ContentTime::from_seconds (_next->in().to_seconds()) < time) { + while (i != _subtitles.end() && ContentTime::from_seconds (_next->in().as_seconds()) < time) { ++i; } } @@ -65,7 +65,7 @@ DCPSubtitleDecoder::image_subtitles_during (ContentTimePeriod, bool) const { return list (); } - + list DCPSubtitleDecoder::text_subtitles_during (ContentTimePeriod p, bool starting) const { @@ -75,10 +75,10 @@ DCPSubtitleDecoder::text_subtitles_during (ContentTimePeriod p, bool starting) c for (list::const_iterator i = _subtitles.begin(); i != _subtitles.end(); ++i) { ContentTimePeriod period ( - ContentTime::from_seconds (i->in().to_seconds ()), - ContentTime::from_seconds (i->out().to_seconds ()) + ContentTime::from_seconds (i->in().as_seconds ()), + ContentTime::from_seconds (i->out().as_seconds ()) ); - + if ((starting && p.contains (period.from)) || (!starting && p.overlaps (period))) { d.push_back (period); }