summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-10-14 11:53:57 +0100
committerCarl Hetherington <cth@carlh.net>2013-10-14 11:53:57 +0100
commit3aa2d90dfea24d7dca4ebea7f06b97d1a57fa2a5 (patch)
tree9ca1939ff78dd4f5105ad6fcfa2804d78be6bcb6 /src/lib
parentc1023c114a616e5525ebf3ad2a2a1e36af0a1baf (diff)
Try to prevent crashes if the configuration contains no colour conversions.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/video_content.cc13
-rw-r--r--src/lib/video_content.h2
2 files changed, 11 insertions, 4 deletions
diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc
index 3f6e171a5..af0c3e12c 100644
--- a/src/lib/video_content.cc
+++ b/src/lib/video_content.cc
@@ -19,6 +19,7 @@
#include <iomanip>
#include <libcxml/cxml.h>
+#include <libdcp/colour_matrix.h>
#include "video_content.h"
#include "video_examiner.h"
#include "ratio.h"
@@ -49,9 +50,8 @@ VideoContent::VideoContent (shared_ptr<const Film> f, Time s, VideoContent::Fram
, _video_frame_rate (0)
, _video_frame_type (VIDEO_FRAME_TYPE_2D)
, _ratio (Ratio::from_id ("185"))
- , _colour_conversion (Config::instance()->colour_conversions().front().conversion)
{
-
+ setup_default_colour_conversion ();
}
VideoContent::VideoContent (shared_ptr<const Film> f, boost::filesystem::path p)
@@ -60,9 +60,8 @@ VideoContent::VideoContent (shared_ptr<const Film> f, boost::filesystem::path p)
, _video_frame_rate (0)
, _video_frame_type (VIDEO_FRAME_TYPE_2D)
, _ratio (Ratio::from_id ("185"))
- , _colour_conversion (Config::instance()->colour_conversions().front().conversion)
{
-
+ setup_default_colour_conversion ();
}
VideoContent::VideoContent (shared_ptr<const Film> f, shared_ptr<const cxml::Node> node)
@@ -104,6 +103,12 @@ VideoContent::as_xml (xmlpp::Node* node) const
}
void
+VideoContent::setup_default_colour_conversion ()
+{
+ _colour_conversion = PresetColourConversion (_("sRGB"), 2.4, true, libdcp::colour_matrix::srgb_to_xyz, 2.6).conversion;
+}
+
+void
VideoContent::take_from_video_examiner (shared_ptr<VideoExaminer> d)
{
/* These examiner calls could call other content methods which take a lock on the mutex */
diff --git a/src/lib/video_content.h b/src/lib/video_content.h
index 72c72625b..81325516d 100644
--- a/src/lib/video_content.h
+++ b/src/lib/video_content.h
@@ -109,6 +109,8 @@ private:
friend class best_dcp_frame_rate_test_single;
friend class best_dcp_frame_rate_test_double;
friend class audio_sampling_rate_test;
+
+ void setup_default_colour_conversion ();
libdcp::Size _video_size;
float _video_frame_rate;