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:33:26 +0000
commit19eef2cafc28a485d18145392977e3ad650569fe (patch)
tree5c191c6e522cfdfc7521750965c3ce58f6dd95e4 /src/lib/dcp_decoder.cc
parent2a434c744338ff23ca99e21a130afaf042300ada (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 ();
}