summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-10-25 23:52:42 +0100
committerCarl Hetherington <cth@carlh.net>2014-10-25 23:52:42 +0100
commite749511fb4839feaccc94d506fa13b89ab13a570 (patch)
tree9076816deefe1737c0c0161e823d150e89cd493a /src/lib
parent9fb8582bec18471ed9f6e3feb71aca5d1c9e6d3f (diff)
Fix crash when signalling VideoContent during the constructor (hence indirectly causing shared_from_this to be called too early).
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/video_content.cc17
-rw-r--r--src/lib/video_content.h2
2 files changed, 13 insertions, 6 deletions
diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc
index 976bc3aa0..98c3d929a 100644
--- a/src/lib/video_content.cc
+++ b/src/lib/video_content.cc
@@ -65,7 +65,7 @@ VideoContent::VideoContent (shared_ptr<const Film> f)
, _video_frame_type (VIDEO_FRAME_TYPE_2D)
, _scale (Config::instance()->default_scale ())
{
- set_default_colour_conversion ();
+ set_default_colour_conversion (false);
}
VideoContent::VideoContent (shared_ptr<const Film> f, DCPTime s, ContentTime len)
@@ -75,7 +75,7 @@ VideoContent::VideoContent (shared_ptr<const Film> f, DCPTime s, ContentTime len
, _video_frame_type (VIDEO_FRAME_TYPE_2D)
, _scale (Config::instance()->default_scale ())
{
- set_default_colour_conversion ();
+ set_default_colour_conversion (false);
}
VideoContent::VideoContent (shared_ptr<const Film> f, boost::filesystem::path p)
@@ -85,7 +85,7 @@ VideoContent::VideoContent (shared_ptr<const Film> f, boost::filesystem::path p)
, _video_frame_type (VIDEO_FRAME_TYPE_2D)
, _scale (Config::instance()->default_scale ())
{
- set_default_colour_conversion ();
+ set_default_colour_conversion (false);
}
VideoContent::VideoContent (shared_ptr<const Film> f, cxml::ConstNodePtr node, int version)
@@ -197,9 +197,16 @@ VideoContent::as_xml (xmlpp::Node* node) const
}
void
-VideoContent::set_default_colour_conversion ()
+VideoContent::set_default_colour_conversion (bool signal)
{
- set_colour_conversion (PresetColourConversion (_("sRGB"), 2.4, true, dcp::colour_matrix::srgb_to_xyz, 2.6).conversion);
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ _colour_conversion = PresetColourConversion (_("sRGB"), 2.4, true, dcp::colour_matrix::srgb_to_xyz, 2.6).conversion;
+ }
+
+ if (signal) {
+ signal_changed (VideoContentProperty::COLOUR_CONVERSION);
+ }
}
void
diff --git a/src/lib/video_content.h b/src/lib/video_content.h
index 3c8e5fefd..b5936d16d 100644
--- a/src/lib/video_content.h
+++ b/src/lib/video_content.h
@@ -91,7 +91,7 @@ public:
void set_scale (VideoContentScale);
void unset_colour_conversion ();
void set_colour_conversion (ColourConversion);
- void set_default_colour_conversion ();
+ void set_default_colour_conversion (bool signal = true);
void set_fade_in (ContentTime);
void set_fade_out (ContentTime);