Merge branch 'master' of /home/carl/git/dvdomatic
[dcpomatic.git] / src / lib / imagemagick_decoder.cc
index 42fe699d715e3f7c8bfce0611d983c9e48ac499d..5ce22c29622a403c33425a5ce6e8e9a5f3e26de5 100644 (file)
@@ -25,6 +25,8 @@
 #include "film.h"
 #include "exceptions.h"
 
+#include "i18n.h"
+
 using std::cout;
 using boost::shared_ptr;
 using libdcp::Size;
@@ -55,7 +57,7 @@ libdcp::Size
 ImageMagickDecoder::native_size () const
 {
        if (_files.empty ()) {
-               throw DecodeError ("no still image files found");
+               throw DecodeError (_("no still image files found"));
        }
 
        /* Look at the first file and assume its size holds for all */
@@ -75,7 +77,7 @@ ImageMagickDecoder::pass ()
                        return true;
                }
 
-               repeat_last_video ();
+               emit_video (_image, true, double (video_frame()) / frames_per_second());
                return false;
        }
        
@@ -98,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;
@@ -148,3 +150,9 @@ ImageMagickDecoder::film_changed (Film::Property p)
                OutputChanged ();
        }
 }
+
+float
+ImageMagickDecoder::frames_per_second () const
+{
+       return _film->source_frame_rate ();
+}