Merge master.
[dcpomatic.git] / src / lib / image_examiner.cc
index 17064fd45ce10b0827fdb5c6ffddce51c363ed4c..3897bbf37b0a5f4c2fc219e0b47c12712ae3708e 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -36,24 +36,23 @@ using boost::shared_ptr;
 using boost::lexical_cast;
 using boost::bad_lexical_cast;
 
-ImageExaminer::ImageExaminer (shared_ptr<const Film> film, shared_ptr<const ImageContent> content, shared_ptr<Job> job)
+ImageExaminer::ImageExaminer (shared_ptr<const Film> film, shared_ptr<const ImageContent> content, shared_ptr<Job>)
        : _film (film)
        , _image_content (content)
-       , _video_length (0)
 {
        using namespace MagickCore;
        Magick::Image* image = new Magick::Image (content->path(0).string());
-       _video_size = libdcp::Size (image->columns(), image->rows());
+       _video_size = dcp::Size (image->columns(), image->rows());
        delete image;
 
        if (content->still ()) {
-               _video_length = Config::instance()->default_still_length() * video_frame_rate();
+               _video_length = ContentTime::from_seconds (Config::instance()->default_still_length());
        } else {
-               _video_length = _image_content->number_of_paths ();
+               _video_length = ContentTime::from_frames (_image_content->number_of_paths (), video_frame_rate ());
        }
 }
 
-libdcp::Size
+dcp::Size
 ImageExaminer::video_size () const
 {
        return _video_size.get ();