summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-12-09 16:30:31 +0000
committerCarl Hetherington <cth@carlh.net>2014-12-09 16:30:31 +0000
commit91f71a29f894c382a7f92cf5fdcb75d9849e2aa7 (patch)
tree8b8fcc0f64287367d6555b54f212150f25ddff26 /src
parent5527d5e1dd40f759e5e4a33561fe89313d23fa20 (diff)
Various fixes pointed out by tests.
Diffstat (limited to 'src')
-rw-r--r--src/lib/content.cc4
-rw-r--r--src/lib/image_examiner.cc2
-rw-r--r--src/lib/video_content.cc5
-rw-r--r--src/wx/content_panel.cc7
4 files changed, 7 insertions, 11 deletions
diff --git a/src/lib/content.cc b/src/lib/content.cc
index cc29345a2..ba83e2627 100644
--- a/src/lib/content.cc
+++ b/src/lib/content.cc
@@ -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;
diff --git a/src/lib/image_examiner.cc b/src/lib/image_examiner.cc
index d6c7d0502..e8db326c7 100644
--- a/src/lib/image_examiner.cc
+++ b/src/lib/image_examiner.cc
@@ -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)
);
}
}
diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc
index 1fe02bae4..1da5d87c1 100644
--- a/src/lib/video_content.cc
+++ b/src/lib/video_content.cc
@@ -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;
diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc
index 2dc75f8c2..4d73a608d 100644
--- a/src/wx/content_panel.cc
+++ b/src/wx/content_panel.cc
@@ -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 ();