using boost::shared_ptr;
using libdcp::Size;
-ImageMagickDecoder::ImageMagickDecoder (
- shared_ptr<const Film> f, shared_ptr<ImageMagickContent> c, DecodeOptions o)
- : Decoder (f, o)
- , VideoDecoder (f, c, o)
+ImageMagickDecoder::ImageMagickDecoder (shared_ptr<const Film> f, shared_ptr<const ImageMagickContent> c)
+ : Decoder (f)
+ , VideoDecoder (f)
, _imagemagick_content (c)
, _position (0)
{
return s;
}
+int
+ImageMagickDecoder::video_length () const
+{
+ return _imagemagick_content->video_length ();
+}
+
bool
ImageMagickDecoder::pass ()
{
- if (_position > 0 && _position < _imagemagick_content->video_length ()) {
- repeat_last_video ();
+ if (_position < 0 || _position >= _imagemagick_content->video_length ()) {
+ return true;
+ }
+
+ if (have_last_video ()) {
+ repeat_last_video (double (_position) / 24);
_position++;
return false;
- } else if (_position >= _imagemagick_content->video_length ()) {
- return true;
}
Magick::Image* magick_image = new Magick::Image (_imagemagick_content->file().string ());
image = image->crop (_film->crop(), true);
- emit_video (image, 0);
+ emit_video (image, double (_position) / 24);
++_position;
return false;
_position = f;
return false;
}
-
-void
-ImageMagickDecoder::film_changed (Film::Property p)
-{
- if (p == Film::CROP) {
- OutputChanged ();
- }
-}