X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fdcp_decoder.cc;h=e8ace8beedcfb61b2b0604103acd099c64e4b5d0;hb=e03d6f9bc6af9dfa8602c82cc52040a92144deaf;hp=340ef5d93352a882d6f43f50c70ad2dbec1215e1;hpb=da39ed1516f2463f8a9bf4795a94f23d420c9ca3;p=dcpomatic.git diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc index 340ef5d93..e8ace8bee 100644 --- a/src/lib/dcp_decoder.cc +++ b/src/lib/dcp_decoder.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2014-2018 Carl Hetherington + Copyright (C) 2014-2020 Carl Hetherington This file is part of DCP-o-matic. @@ -28,6 +28,7 @@ #include "ffmpeg_image_proxy.h" #include "image.h" #include "config.h" +#include "frame_interval_checker.h" #include #include #include @@ -106,7 +107,14 @@ DCPDecoder::DCPDecoder (shared_ptr film, shared_ptrcan_be_played ()) { + if (!_dcp_content->can_be_played()) { + return true; + } + + if (_reel == _reels.end()) { + if (audio) { + audio->flush (); + } return true; } @@ -408,3 +416,9 @@ DCPDecoder::set_forced_reduction (optional reduction) { _forced_reduction = reduction; } + +ContentTime +DCPDecoder::position () const +{ + return ContentTime::from_frames(_offset, _dcp_content->active_video_frame_rate(film())) + _next; +}