Missing FFmpeg include; fixes #989.
[dcpomatic.git] / src / lib / dcp_content.cc
index 96e9f17a259f44e11b3b81859d0422b33308e6c0..dc32a243e89245221ec37b9906626bf31a39d6b3 100644 (file)
@@ -59,6 +59,7 @@ int const DCPContentProperty::NEEDS_KDM          = 601;
 int const DCPContentProperty::REFERENCE_VIDEO    = 602;
 int const DCPContentProperty::REFERENCE_AUDIO    = 603;
 int const DCPContentProperty::REFERENCE_SUBTITLE = 604;
+int const DCPContentProperty::NAME               = 605;
 
 DCPContent::DCPContent (shared_ptr<const Film> film, boost::filesystem::path p)
        : Content (film)
@@ -138,6 +139,7 @@ DCPContent::examine (shared_ptr<Job> job)
 {
        bool const needed_assets = needs_assets ();
        bool const needed_kdm = needs_kdm ();
+       string const old_name = name ();
 
        job->set_progress_unknown ();
        Content::examine (job);
@@ -180,6 +182,10 @@ DCPContent::examine (shared_ptr<Job> job)
                signal_changed (DCPContentProperty::NEEDS_KDM);
        }
 
+       if (old_name != name ()) {
+               signal_changed (DCPContentProperty::NAME);
+       }
+
        video->set_frame_type (_three_d ? VIDEO_FRAME_TYPE_3D : VIDEO_FRAME_TYPE_2D);
 }
 
@@ -444,6 +450,11 @@ DCPContent::can_reference (function<shared_ptr<ContentPart> (shared_ptr<const Co
 bool
 DCPContent::can_reference_video (list<string>& why_not) const
 {
+       if (film()->frame_size() != video->size()) {
+               why_not.push_back (_("The video frame size in the film differs from that in the DCP."));
+               return false;
+       }
+
        return can_reference (bind (&Content::video, _1), _("There is other video content overlapping this DCP; remove it."), why_not);
 }
 
@@ -458,7 +469,7 @@ DCPContent::can_reference_audio (list<string>& why_not) const
                 }
         }
 
-        return can_reference (bind (&Content::audio, _1),   _("There is other audio content overlapping this DCP; remove it."), why_not);
+        return can_reference (bind (&Content::audio, _1), _("There is other audio content overlapping this DCP; remove it."), why_not);
 }
 
 bool
@@ -485,3 +496,10 @@ DCPContent::use_template (shared_ptr<const Content> c)
        _reference_audio = dc->_reference_audio;
        _reference_subtitle = dc->_reference_subtitle;
 }
+
+void
+DCPContent::set_cpl (string id)
+{
+       boost::mutex::scoped_lock lm (_mutex);
+       _cpl = id;
+}