Attempt to make more concessions for Centos 5.
[dcpomatic.git] / src / lib / image_content.cc
index 29af451b7edcaa03ca8a543b34a95c0b83b27098..6d1738419bab10287a9df5149d2d31bec911a255 100644 (file)
@@ -41,7 +41,7 @@ using boost::shared_ptr;
 ImageContent::ImageContent (shared_ptr<const Film> film, boost::filesystem::path p)
        : Content (film)
 {
-       video.reset (new VideoContent (this, film));
+       video.reset (new VideoContent (this));
 
        if (boost::filesystem::is_regular_file (p) && valid_image_file (p)) {
                _paths.push_back (p);
@@ -66,7 +66,7 @@ ImageContent::ImageContent (shared_ptr<const Film> film, boost::filesystem::path
 ImageContent::ImageContent (shared_ptr<const Film> film, cxml::ConstNodePtr node, int version)
        : Content (film, node)
 {
-       video.reset (new VideoContent (this, film, node, version));
+       video = VideoContent::from_xml (this, node, version);
 }
 
 string
@@ -103,7 +103,10 @@ ImageContent::as_xml (xmlpp::Node* node) const
 {
        node->add_child("Type")->add_child_text ("Image");
        Content::as_xml (node);
-       video->as_xml (node);
+
+       if (video) {
+               video->as_xml (node);
+       }
 }
 
 void
@@ -124,7 +127,7 @@ ImageContent::full_length () const
 {
        shared_ptr<const Film> film = _film.lock ();
        DCPOMATIC_ASSERT (film);
-       FrameRateChange const frc (video->frame_rate(), film->video_frame_rate());
+       FrameRateChange const frc (active_video_frame_rate(), film->video_frame_rate());
        return DCPTime::from_frames (llrint (video->length_after_3d_combine() * frc.factor ()), film->video_frame_rate ());
 }