Try to fix missing icons in OS X .dmg.
[dcpomatic.git] / src / lib / player.cc
index 42551889b03563f2dbea0f8e779ddbcddfdd767e..d05597dd556540f50839f35fd57510fee75e7243 100644 (file)
@@ -126,7 +126,7 @@ Player::Player (shared_ptr<const Film> f, shared_ptr<const Playlist> p)
        _playlist_changed_connection = _playlist->Changed.connect (bind (&Player::playlist_changed, this));
        _playlist_content_changed_connection = _playlist->ContentChanged.connect (bind (&Player::content_changed, this, _1, _2, _3));
        _film_changed_connection = _film->Changed.connect (bind (&Player::film_changed, this, _1));
-       set_video_container_size (fit_ratio_within (_film->container()->ratio (), _film->full_frame ()));
+       set_video_container_size (_film->frame_size ());
 }
 
 void
@@ -273,8 +273,7 @@ Player::process_video (weak_ptr<Piece> weak_piece, shared_ptr<const Image> image
        }
 
        Time const time = content->position() + relative_time + extra - content->trim_start ();
-       float const ratio = content->ratio() ? content->ratio()->ratio() : content->video_size_after_crop().ratio();
-       libdcp::Size const image_size = fit_ratio_within (ratio, _video_container_size);
+       libdcp::Size const image_size = content->scale().size (content, _video_container_size, _film->frame_size ());
 
        shared_ptr<PlayerImage> pi (
                new PlayerImage (
@@ -456,6 +455,10 @@ Player::setup_pieces ()
 
        for (ContentList::iterator i = content.begin(); i != content.end(); ++i) {
 
+               if (!(*i)->paths_valid ()) {
+                       continue;
+               }
+
                shared_ptr<Piece> piece (new Piece (*i));
 
                /* XXX: into content? */
@@ -533,7 +536,7 @@ Player::content_changed (weak_ptr<Content> w, int property, bool frequent)
                Changed (frequent);
 
        } else if (
-               property == VideoContentProperty::VIDEO_CROP || property == VideoContentProperty::VIDEO_RATIO ||
+               property == VideoContentProperty::VIDEO_CROP || property == VideoContentProperty::VIDEO_SCALE ||
                property == VideoContentProperty::VIDEO_FRAME_RATE
                ) {
                
@@ -541,6 +544,7 @@ Player::content_changed (weak_ptr<Content> w, int property, bool frequent)
 
        } else if (property == ContentProperty::PATH) {
 
+               _have_valid_pieces = false;
                Changed (frequent);
        }
 }