Hand-apply 6a3cd511559433554ab40ed72ff94b7d8dc2c5bd from master;
[dcpomatic.git] / src / lib / image_examiner.cc
index ef9c13c5a1c1e8b33500d72531bba395372d7563..d6c7d0502cebffb1f0be88e7770d0bfc683d1789 100644 (file)
@@ -34,6 +34,7 @@ using std::cout;
 using std::list;
 using std::sort;
 using boost::shared_ptr;
+using boost::optional;
 
 ImageExaminer::ImageExaminer (shared_ptr<const Film> film, shared_ptr<const ImageContent> content, shared_ptr<Job>)
        : _film (film)
@@ -63,7 +64,9 @@ ImageExaminer::ImageExaminer (shared_ptr<const Film> film, shared_ptr<const Imag
        if (content->still ()) {
                _video_length = ContentTime::from_seconds (Config::instance()->default_still_length());
        } else {
-               _video_length = ContentTime::from_frames (_image_content->number_of_paths (), video_frame_rate ());
+               _video_length = ContentTime::from_frames (
+                       _image_content->number_of_paths (), video_frame_rate().get_value_or (0)
+                       );
        }
 }
 
@@ -73,13 +76,9 @@ ImageExaminer::video_size () const
        return _video_size.get ();
 }
 
-float
+optional<float>
 ImageExaminer::video_frame_rate () const
 {
-       boost::shared_ptr<const Film> f = _film.lock ();
-       if (!f) {
-               return 24;
-       }
-
-       return f->video_frame_rate ();
+       /* Don't know */
+       return optional<float> ();
 }