Basic support for trusted device lists in KDMs (#750).
[dcpomatic.git] / src / lib / image_decoder.cc
index f11d377563ea64d15568e819f61235bcdd66feed..2291daecd7996f85e00ad9bdc7d6cc9a96e8be90 100644 (file)
@@ -37,14 +37,15 @@ using dcp::Size;
 ImageDecoder::ImageDecoder (shared_ptr<const ImageContent> c)
        : VideoDecoder (c)
        , _image_content (c)
+       , _video_position (0)
 {
 
 }
 
 bool
-ImageDecoder::pass ()
+ImageDecoder::pass (PassReason, bool)
 {
-       if (_video_position >= _image_content->video_length().frames (_image_content->video_frame_rate ())) {
+       if (_video_position >= _image_content->video_length()) {
                return true;
        }
 
@@ -60,7 +61,7 @@ ImageDecoder::pass ()
                        _image.reset (new MagickImageProxy (path));
                }
        }
-               
+
        video (_image, _video_position);
        ++_video_position;
        return false;
@@ -70,5 +71,5 @@ void
 ImageDecoder::seek (ContentTime time, bool accurate)
 {
        VideoDecoder::seek (time, accurate);
-       _video_position = time.frames (_image_content->video_frame_rate ());
+       _video_position = time.frames_round (_image_content->video_frame_rate ());
 }