summaryrefslogtreecommitdiff
path: root/src/lib/dcp_decoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-02-18 00:33:26 +0000
committerCarl Hetherington <cth@carlh.net>2018-02-18 00:34:30 +0000
commitbae5624269ccb69ca35df286421942dfa42a8ef8 (patch)
tree690479fa19a489a3e8493673fda12dfd7dcc1513 /src/lib/dcp_decoder.cc
parent840a313db32056549f3730af4b0089755bb5b753 (diff)
Set up seek position correctly when a seek skips over a reel in
a DCP.
Diffstat (limited to 'src/lib/dcp_decoder.cc')
-rw-r--r--src/lib/dcp_decoder.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc
index 2ffe11065..b49081dfe 100644
--- a/src/lib/dcp_decoder.cc
+++ b/src/lib/dcp_decoder.cc
@@ -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 ();
}