Merge branch 'master' of ssh://git.carlh.net/home/carl/git/dcpomatic
[dcpomatic.git] / src / lib / image_decoder.cc
index 6d8f878efeef1a8fe0dd1cd44bed12708c11849b..e06f6023d54a8d35b1203f81eef72e823ab9ed0d 100644 (file)
 #include "image_decoder.h"
 #include "video_decoder.h"
 #include "image.h"
-#include "magick_image_proxy.h"
+#include "ffmpeg_image_proxy.h"
 #include "j2k_image_proxy.h"
 #include "film.h"
 #include "exceptions.h"
 #include "video_content.h"
-#include <Magick++.h>
 #include <boost/filesystem.hpp>
 #include <iostream>
 
@@ -44,11 +43,11 @@ ImageDecoder::ImageDecoder (shared_ptr<const ImageContent> c, shared_ptr<Log> lo
        video.reset (new VideoDecoder (this, c, log));
 }
 
-void
+bool
 ImageDecoder::pass ()
 {
        if (_frame_video_position >= _image_content->video->length()) {
-               return;
+               return true;
        }
 
        if (!_image_content->still() || !_image) {
@@ -68,17 +67,18 @@ ImageDecoder::pass ()
                        */
                        _image.reset (new J2KImageProxy (path, _image_content->video->size(), pf));
                } else {
-                       _image.reset (new MagickImageProxy (path));
+                       _image.reset (new FFmpegImageProxy (path));
                }
        }
 
        video->emit (_image, _frame_video_position);
        ++_frame_video_position;
-       return;
+       return false;
 }
 
 void
-ImageDecoder::seek (ContentTime time, bool)
+ImageDecoder::seek (ContentTime time, bool accurate)
 {
+       Decoder::seek (time, accurate);
        _frame_video_position = time.frames_round (_image_content->active_video_frame_rate ());
 }