Set up seek position correctly when a seek skips over a reel in
authorCarl Hetherington <cth@carlh.net>
Sun, 18 Feb 2018 00:33:26 +0000 (00:33 +0000)
committerCarl Hetherington <cth@carlh.net>
Sun, 18 Feb 2018 00:34:30 +0000 (00:34 +0000)
a DCP.

src/lib/dcp_decoder.cc

index 2ffe110655d8f676217f6ee6af38d0fab0b95d5a..b49081dfeb303af13b8d0cfbc9370d8bcdc8b3ff 100644 (file)
@@ -271,7 +271,9 @@ DCPDecoder::seek (ContentTime t, bool accurate)
        /* Seek to pre-roll position */
 
        while (_reel != _reels.end() && pre >= ContentTime::from_frames ((*_reel)->main_picture()->duration(), _dcp_content->active_video_frame_rate ())) {
-               pre -= ContentTime::from_frames ((*_reel)->main_picture()->duration(), _dcp_content->active_video_frame_rate ());
+               ContentTime rd = ContentTime::from_frames ((*_reel)->main_picture()->duration(), _dcp_content->active_video_frame_rate ());
+               pre -= rd;
+               t -= rd;
                next_reel ();
        }