From 3aa2d90dfea24d7dca4ebea7f06b97d1a57fa2a5 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 14 Oct 2013 11:53:57 +0100 Subject: Try to prevent crashes if the configuration contains no colour conversions. --- src/lib/video_content.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/lib/video_content.cc') 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 #include +#include #include "video_content.h" #include "video_examiner.h" #include "ratio.h" @@ -49,9 +50,8 @@ VideoContent::VideoContent (shared_ptr 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 f, boost::filesystem::path p) @@ -60,9 +60,8 @@ VideoContent::VideoContent (shared_ptr 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 f, shared_ptr node) @@ -103,6 +102,12 @@ VideoContent::as_xml (xmlpp::Node* node) const _colour_conversion.as_xml (node->add_child("ColourConversion")); } +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 d) { -- cgit v1.2.3