Clean up a bit by using Content::film() more.
[dcpomatic.git] / src / lib / playlist.cc
index 4aff1015d53381652d5a15de877f90b7019d1a63..c5cd4b02d0149c52fdd2000f9bd994343695e9a3 100644 (file)
@@ -33,6 +33,7 @@
 #include <libxml++/libxml++.h>
 #include <boost/shared_ptr.hpp>
 #include <boost/foreach.hpp>
+#include <iostream>
 
 #include "i18n.h"
 
@@ -96,10 +97,10 @@ Playlist::maybe_sequence_video ()
 
                if (vc->video_frame_type() == VIDEO_FRAME_TYPE_3D_RIGHT) {
                        vc->set_position (next_right);
-                       next_right = vc->end() + DCPTime::delta ();
+                       next_right = vc->end();
                } else {
                        vc->set_position (next_left);
-                       next_left = vc->end() + DCPTime::delta ();
+                       next_left = vc->end();
                }
        }
 
@@ -211,7 +212,7 @@ Playlist::best_dcp_frame_rate () const
 {
        list<int> const allowed_dcp_frame_rates = Config::instance()->allowed_dcp_frame_rates ();
 
-       /* Work out what rates we could manage, including those achieved by using skip / repeat. */
+       /* Work out what rates we could manage, including those achieved by using skip / repeat */
        list<FrameRateCandidate> candidates;
 
        /* Start with the ones without skip / repeat so they will get matched in preference to skipped/repeated ones */
@@ -234,7 +235,7 @@ Playlist::best_dcp_frame_rate () const
                float this_error = 0;
                BOOST_FOREACH (shared_ptr<Content> j, _content) {
                        shared_ptr<VideoContent> vc = dynamic_pointer_cast<VideoContent> (j);
-                       if (!vc) {
+                       if (!vc || !vc->has_own_video_frame_rate()) {
                                continue;
                        }
 
@@ -350,7 +351,7 @@ ContentSorter::operator() (shared_ptr<Content> a, shared_ptr<Content> b)
        return a->position() < b->position();
 }
 
-/** @return content in an undefined order */
+/** @return content in ascending order of position */
 ContentList
 Playlist::content () const
 {