_active_subtitles.clear ();
BOOST_FOREACH (shared_ptr<Piece> i, _pieces) {
- i->done = false;
- DCPTime const t = min(max(time, i->content->position()), i->content->end());
- i->decoder->seek (dcp_to_content_time (i, t), accurate);
+ if (time < i->content->position()) {
+ /* Before; seek to 0 */
+ i->decoder->seek (ContentTime(), accurate);
+ i->done = false;
+ } else if (i->content->position() <= time && time < i->content->end()) {
+ /* During; seek to position */
+ i->decoder->seek (dcp_to_content_time (i, time), accurate);
+ i->done = false;
+ } else {
+ /* After; this piece is done */
+ i->done = true;
+ }
}
if (accurate) {