Various fixes pointed out by tests.
authorCarl Hetherington <cth@carlh.net>
Tue, 9 Dec 2014 16:30:31 +0000 (16:30 +0000)
committerCarl Hetherington <cth@carlh.net>
Tue, 9 Dec 2014 16:30:31 +0000 (16:30 +0000)
src/lib/content.cc
src/lib/image_examiner.cc
src/lib/video_content.cc
src/wx/content_panel.cc

index cc29345a298f9b15d25444f439e3d2580dca8efa..ba83e262704446652f1a809bc45fed5847d14306 100644 (file)
@@ -139,7 +139,9 @@ Content::examine (shared_ptr<Job> job, bool calculate_digest)
                return;
        }
 
-       job->sub (_("Computing digest"));
+       if (job) {
+               job->sub (_("Computing digest"));
+       }
        
        boost::mutex::scoped_lock lm (_mutex);
        vector<boost::filesystem::path> p = _paths;
index d6c7d0502cebffb1f0be88e7770d0bfc683d1789..e8db326c71b513e0389b7c55bb1a374fe79b8da3 100644 (file)
@@ -65,7 +65,7 @@ ImageExaminer::ImageExaminer (shared_ptr<const Film> film, shared_ptr<const Imag
                _video_length = ContentTime::from_seconds (Config::instance()->default_still_length());
        } else {
                _video_length = ContentTime::from_frames (
-                       _image_content->number_of_paths (), video_frame_rate().get_value_or (0)
+                       _image_content->number_of_paths (), video_frame_rate().get_value_or (24)
                        );
        }
 }
index 1fe02bae4551134e02a57873e2c1eb5ebd1dc3ed..1da5d87c16778046c1720c972c783000ae4bd559 100644 (file)
@@ -228,9 +228,8 @@ VideoContent::take_from_video_examiner (shared_ptr<VideoExaminer> d)
        {
                boost::mutex::scoped_lock lm (_mutex);
                _video_size = vs;
-               if (vfr) {
-                       _video_frame_rate = vfr.get ();
-               }
+               /* Default video frame rate to 24fps if the examiner doesn't know */
+               _video_frame_rate = vfr.get_value_or (24);
                _video_length = vl;
                _sample_aspect_ratio = ar;
 
index 2dc75f8c24753e18a18f6833e7001b892ff2092b..4d73a608dcb2b329f7c262c95d2561f02b9265a9 100644 (file)
@@ -248,12 +248,7 @@ ContentPanel::add_file_clicked ()
        /* XXX: check for lots of files here and do something */
 
        for (unsigned int i = 0; i < paths.GetCount(); ++i) {
-               shared_ptr<Content> c = content_factory (_film, wx_to_std (paths[i]));
-               shared_ptr<ImageContent> ic = dynamic_pointer_cast<ImageContent> (c);
-               if (ic) {
-                       ic->set_video_frame_rate (24);
-               }
-               _film->examine_and_add_content (c, true);
+               _film->examine_and_add_content (content_factory (_film, wx_to_std (paths[i])), true);
        }
 
        d->Destroy ();