using boost::shared_ptr;
using boost::bind;
-DCPSubtitleDecoder::DCPSubtitleDecoder (shared_ptr<const DCPSubtitleContent> content)
+DCPSubtitleDecoder::DCPSubtitleDecoder (shared_ptr<const DCPSubtitleContent> content, shared_ptr<Log> log)
{
subtitle.reset (
new SubtitleDecoder (
this,
content->subtitle,
+ log,
bind (&DCPSubtitleDecoder::image_subtitles_during, this, _1, _2),
bind (&DCPSubtitleDecoder::text_subtitles_during, this, _1, _2)
)
}
subtitle->give_text (p, s);
+ subtitle->set_position (p.from);
return false;
}
for (list<dcp::SubtitleString>::const_iterator i = _subtitles.begin(); i != _subtitles.end(); ++i) {
ContentTimePeriod period = content_time_period (*i);
- if ((starting && p.contains (period.from)) || (!starting && p.overlaps (period))) {
+ if ((starting && p.contains(period.from)) || (!starting && p.overlap(period))) {
d.push_back (period);
}
}
+ d.sort ();
+ d.unique ();
+
return d;
}