Try to fix the filter / AVFrame ownership.
[dcpomatic.git] / src / lib / imagemagick_decoder.cc
index 38dace6deb54b5669986a04868daa611b917c134..5ce22c29622a403c33425a5ce6e8e9a5f3e26de5 100644 (file)
@@ -77,8 +77,7 @@ ImageMagickDecoder::pass ()
                        return true;
                }
 
-               /* XXX: timestamp is wrong */
-               repeat_last_video (0);
+               emit_video (_image, true, double (video_frame()) / frames_per_second());
                return false;
        }
        
@@ -101,9 +100,9 @@ ImageMagickDecoder::pass ()
 
        delete magick_image;
 
-       image = image->crop (_film->crop(), true);
-       
-       emit_video (image, 0);
+       _image = image->crop (_film->crop(), true);
+
+       emit_video (_image, false, double (video_frame()) / frames_per_second());
 
        ++_iter;
        return false;
@@ -151,3 +150,9 @@ ImageMagickDecoder::film_changed (Film::Property p)
                OutputChanged ();
        }
 }
+
+float
+ImageMagickDecoder::frames_per_second () const
+{
+       return _film->source_frame_rate ();
+}