Merge master.
[dcpomatic.git] / src / lib / playlist.cc
index 5203160a876373258748e6c7b0f0663c3375d66c..16c740943ca89f382f27082ba70a935d987c484b 100644 (file)
@@ -186,19 +186,6 @@ Playlist::remove (ContentList c)
        Changed ();
 }
 
-bool
-Playlist::has_subtitles () const
-{
-       for (ContentList::const_iterator i = _content.begin(); i != _content.end(); ++i) {
-               shared_ptr<const FFmpegContent> fc = dynamic_pointer_cast<FFmpegContent> (*i);
-               if (fc && !fc->subtitle_streams().empty()) {
-                       return true;
-               }
-       }
-
-       return false;
-}
-
 class FrameRateCandidate
 {
 public:
@@ -306,7 +293,7 @@ Playlist::active_frame_rate_change (DCPTime t, int dcp_video_frame_rate) const
        for (ContentList::const_iterator i = _content.begin(); i != _content.end(); ++i) {
                shared_ptr<const VideoContent> vc = dynamic_pointer_cast<const VideoContent> (*i);
                if (!vc) {
-                       break;
+                       continue;
                }
 
                if (vc->position() >= t && t < vc->end()) {
@@ -379,13 +366,12 @@ Playlist::move_earlier (shared_ptr<Content> c)
        if (previous == _content.end ()) {
                return;
        }
+
        
        DCPTime const p = (*previous)->position ();
        (*previous)->set_position (p + c->length_after_trim ());
        c->set_position (p);
        sort (_content.begin(), _content.end(), ContentSorter ());
-       
-       Changed ();
 }
 
 void
@@ -407,10 +393,7 @@ Playlist::move_later (shared_ptr<Content> c)
                return;
        }
 
-       DCPTime const p = (*next)->position ();
        (*next)->set_position (c->position ());
-       c->set_position (p + c->length_after_trim ());
+       c->set_position (c->position() + c->length_after_trim ());
        sort (_content.begin(), _content.end(), ContentSorter ());
-       
-       Changed ();
 }