Allow content parts to not be preset in XML.
[dcpomatic.git] / src / lib / ffmpeg_content.cc
index 463722778d1fafb867044b9fc2ac05e2cd4c6737..a8206b13e05cdf0fa1ee7415027b714825a51f83 100644 (file)
@@ -74,9 +74,9 @@ FFmpegContent::FFmpegContent (shared_ptr<const Film> film, boost::filesystem::pa
 FFmpegContent::FFmpegContent (shared_ptr<const Film> film, cxml::ConstNodePtr node, int version, list<string>& notes)
        : Content (film, node)
 {
-       video.reset (new VideoContent (this, film, node, version));
-       audio.reset (new AudioContent (this, film, node));
-       subtitle.reset (new SubtitleContent (this, film, node, version));
+       video = VideoContent::from_xml (this, film, node, version);
+       audio = AudioContent::from_xml (this, film, node);
+       subtitle = SubtitleContent::from_xml (this, film, node, version);
 
        list<cxml::NodePtr> c = node->node_children ("SubtitleStream");
        for (list<cxml::NodePtr>::const_iterator i = c.begin(); i != c.end(); ++i) {
@@ -296,7 +296,7 @@ operator!= (FFmpegStream const & a, FFmpegStream const & b)
 DCPTime
 FFmpegContent::full_length () const
 {
-       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());
 }
 
@@ -499,14 +499,6 @@ FFmpegContent::signal_subtitle_stream_changed ()
        signal_changed (FFmpegContentProperty::SUBTITLE_STREAM);
 }
 
-void
-FFmpegContent::changed (int property)
-{
-       if (property == VideoContentProperty::FRAME_RATE && subtitle) {
-               subtitle->set_video_frame_rate (video->frame_rate ());
-       }
-}
-
 vector<shared_ptr<FFmpegAudioStream> >
 FFmpegContent::ffmpeg_audio_streams () const
 {