When seeking to the start of some content, take trim into account
authorCarl Hetherington <cth@carlh.net>
Tue, 17 Apr 2018 14:50:03 +0000 (15:50 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 18 Apr 2018 00:28:25 +0000 (01:28 +0100)
so that we don't have to run through the whole of the trimmed
portion to get to the data we want.

src/lib/player.cc

index 7e2f8ad085ff23a6703f13f7f19d22860c4b3748..148e0a3c5842bc2115cf0790179167a29924d4c7 100644 (file)
@@ -959,8 +959,8 @@ Player::seek (DCPTime time, bool accurate)
 
        BOOST_FOREACH (shared_ptr<Piece> i, _pieces) {
                if (time < i->content->position()) {
-                       /* Before; seek to 0 */
-                       i->decoder->seek (ContentTime(), accurate);
+                       /* Before; seek to the start of the content */
+                       i->decoder->seek (dcp_to_content_time (i, i->content->position()), accurate);
                        i->done = false;
                } else if (i->content->position() <= time && time < i->content->end()) {
                        /* During; seek to position */