summaryrefslogtreecommitdiff
path: root/src/lib/dcp_content.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-08-13 17:37:52 +0100
committerCarl Hetherington <cth@carlh.net>2018-08-14 00:05:06 +0100
commit1fe6bd7f8ba059322b8357b2210f0fd590567ce2 (patch)
tree2c76fbf24b9b520f94f741040f11dc920d3bab91 /src/lib/dcp_content.cc
parentf30ad4dec0a3fa5f1770fba93106a3e8910d66ba (diff)
More fixes for errors / crashes / misbehaviour with content changes
and the butler. Here we signal both before and after a change in content. Before, the player disables itself so that any pass()/seek() will be no-ops. After, the player rebuilds its pieces and the butler re-seeks to get back to where it was before the change.
Diffstat (limited to 'src/lib/dcp_content.cc')
-rw-r--r--src/lib/dcp_content.cc47
1 files changed, 28 insertions, 19 deletions
diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc
index b6a66f90a..a527b1f80 100644
--- a/src/lib/dcp_content.cc
+++ b/src/lib/dcp_content.cc
@@ -61,6 +61,7 @@ int const DCPContentProperty::REFERENCE_AUDIO = 603;
int const DCPContentProperty::REFERENCE_TEXT = 604;
int const DCPContentProperty::NAME = 605;
int const DCPContentProperty::TEXTS = 606;
+int const DCPContentProperty::CPL = 607;
DCPContent::DCPContent (shared_ptr<const Film> film, boost::filesystem::path p)
: Content (film)
@@ -158,6 +159,12 @@ DCPContent::examine (shared_ptr<Job> job)
string const old_name = name ();
int const old_texts = text.size ();
+ ContentChange cc_texts (this, DCPContentProperty::TEXTS);
+ ContentChange cc_assets (this, DCPContentProperty::NEEDS_ASSETS);
+ ContentChange cc_kdm (this, DCPContentProperty::NEEDS_KDM);
+ ContentChange cc_name (this, DCPContentProperty::NAME);
+ ContentChange cc_streams (this, AudioContentProperty::STREAMS);
+
if (job) {
job->set_progress_unknown ();
}
@@ -175,6 +182,7 @@ DCPContent::examine (shared_ptr<Job> job)
}
if (examiner->has_audio()) {
+ ContentChange cc (this, AudioContentProperty::STREAMS);
{
boost::mutex::scoped_lock lm (_mutex);
audio.reset (new AudioContent (this));
@@ -184,7 +192,6 @@ DCPContent::examine (shared_ptr<Job> job)
AudioMapping m = as->mapping ();
film()->make_audio_mapping_default (m);
as->set_mapping (m);
- signal_changed (AudioContentProperty::STREAMS);
}
int texts = 0;
@@ -206,24 +213,22 @@ DCPContent::examine (shared_ptr<Job> job)
_reel_lengths = examiner->reel_lengths ();
}
- if (old_texts != texts) {
- signal_changed (DCPContentProperty::TEXTS);
+ if (old_texts == texts) {
+ cc_texts.abort ();
}
- if (needed_assets != needs_assets ()) {
- signal_changed (DCPContentProperty::NEEDS_ASSETS);
+ if (needed_assets == needs_assets()) {
+ cc_assets.abort ();
}
- if (needed_kdm != needs_kdm ()) {
- signal_changed (DCPContentProperty::NEEDS_KDM);
+ if (needed_kdm == needs_kdm()) {
+ cc_kdm.abort ();
}
- if (old_name != name ()) {
- signal_changed (DCPContentProperty::NAME);
+ if (old_name == name()) {
+ cc_name.abort ();
}
- signal_changed (AudioContentProperty::STREAMS);
-
if (video) {
video->set_frame_type (_three_d ? VIDEO_FRAME_TYPE_3D : VIDEO_FRAME_TYPE_2D);
}
@@ -396,34 +401,34 @@ DCPContent::set_default_colour_conversion ()
void
DCPContent::set_reference_video (bool r)
{
+ ContentChange cc (this, DCPContentProperty::REFERENCE_VIDEO);
+
{
boost::mutex::scoped_lock lm (_mutex);
_reference_video = r;
}
-
- signal_changed (DCPContentProperty::REFERENCE_VIDEO);
}
void
DCPContent::set_reference_audio (bool r)
{
+ ContentChange cc (this, DCPContentProperty::REFERENCE_AUDIO);
+
{
boost::mutex::scoped_lock lm (_mutex);
_reference_audio = r;
}
-
- signal_changed (DCPContentProperty::REFERENCE_AUDIO);
}
void
DCPContent::set_reference_text (TextType type, bool r)
{
+ ContentChange cc (this, DCPContentProperty::REFERENCE_TEXT);
+
{
boost::mutex::scoped_lock lm (_mutex);
_reference_text[type] = r;
}
-
- signal_changed (DCPContentProperty::REFERENCE_TEXT);
}
list<DCPTimePeriod>
@@ -644,6 +649,10 @@ DCPContent::take_settings_from (shared_ptr<const Content> c)
void
DCPContent::set_cpl (string id)
{
- boost::mutex::scoped_lock lm (_mutex);
- _cpl = id;
+ ContentChange cc (this, DCPContentProperty::CPL);
+
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ _cpl = id;
+ }
}