Fix non-translated days of the week (#1455).
[dcpomatic.git] / src / lib / playlist.cc
index c10235f9beb4e91a03d7cfc7adca9d4025dddf78..a6b633f2cfaaac64d06eba62730759574ac65ac7 100644 (file)
@@ -68,6 +68,13 @@ Playlist::~Playlist ()
 void
 Playlist::content_change (weak_ptr<const Film> weak_film, ChangeType type, weak_ptr<Content> content, int property, bool frequent)
 {
+       /* Make sure we only hear about atomic changes (e.g. a PENDING always with the DONE/CANCELLED)
+          Ignore any DONE/CANCELLED that arrives without a PENDING.
+       */
+       if (_checker.send (type, property)) {
+               return;
+       }
+
        shared_ptr<const Film> film = weak_film.lock ();
        DCPOMATIC_ASSERT (film);
 
@@ -311,6 +318,7 @@ public:
        int dcp;
 };
 
+/** @return the best frame rate from Config::_allowed_dcp_frame_rates for the content in this list */
 int
 Playlist::best_video_frame_rate () const
 {
@@ -320,14 +328,14 @@ Playlist::best_video_frame_rate () const
        list<FrameRateCandidate> candidates;
 
        /* Start with the ones without skip / repeat so they will get matched in preference to skipped/repeated ones */
-       for (list<int>::const_iterator i = allowed_dcp_frame_rates.begin(); i != allowed_dcp_frame_rates.end(); ++i) {
-               candidates.push_back (FrameRateCandidate (*i, *i));
+       BOOST_FOREACH (int i, allowed_dcp_frame_rates) {
+               candidates.push_back (FrameRateCandidate(i, i));
        }
 
        /* Then the skip/repeat ones */
-       for (list<int>::const_iterator i = allowed_dcp_frame_rates.begin(); i != allowed_dcp_frame_rates.end(); ++i) {
-               candidates.push_back (FrameRateCandidate (float (*i) / 2, *i));
-               candidates.push_back (FrameRateCandidate (float (*i) * 2, *i));
+       BOOST_FOREACH (int i, allowed_dcp_frame_rates) {
+               candidates.push_back (FrameRateCandidate (float(i) / 2, i));
+               candidates.push_back (FrameRateCandidate (float(i) * 2, i));
        }
 
        /* Pick the best one */