Fix complete failure of preview/playback introduced in v2.15.53
authorCarl Hetherington <cth@carlh.net>
Wed, 22 Apr 2020 23:40:56 +0000 (01:40 +0200)
committerCarl Hetherington <cth@carlh.net>
Wed, 22 Apr 2020 23:40:56 +0000 (01:40 +0200)
4219d4b76c5cd5690b1f4fa0c248d93ced26d05a.

src/lib/player.cc
src/lib/player.h
src/wx/film_viewer.cc

index ab05d42ada522c25627cf5c7381bf13a07c649fb..07447d531db7036ed61ef1ef414d18e9cc1f7685 100644 (file)
@@ -83,6 +83,7 @@ int const PlayerProperty::PLAYLIST = 701;
 int const PlayerProperty::FILM_CONTAINER = 702;
 int const PlayerProperty::FILM_VIDEO_FRAME_RATE = 703;
 int const PlayerProperty::DCP_DECODE_REDUCTION = 704;
+int const PlayerProperty::PLAYBACK_LENGTH = 705;
 
 Player::Player (shared_ptr<const Film> film, shared_ptr<const Playlist> playlist, DCPTime playback_length)
        : _film (film)
@@ -125,6 +126,16 @@ Player::setup_pieces ()
        setup_pieces_unlocked ();
 }
 
+
+void
+Player::set_playback_length (DCPTime len)
+{
+       Change (CHANGE_TYPE_PENDING, PlayerProperty::PLAYBACK_LENGTH, false);
+       _playback_length = len;
+       Change (CHANGE_TYPE_DONE, PlayerProperty::PLAYBACK_LENGTH, false);
+       setup_pieces ();
+}
+
 bool
 have_video (shared_ptr<const Content> content)
 {
index 5a1b08ecf74fef3d9abb4a0747d5191f986641f5..82344604c24e2ff05f25a60ede8fa76e6eea74c3 100644 (file)
@@ -60,6 +60,7 @@ public:
        static int const FILM_CONTAINER;
        static int const FILM_VIDEO_FRAME_RATE;
        static int const DCP_DECODE_REDUCTION;
+       static int const PLAYBACK_LENGTH;
 };
 
 /** @class Player
@@ -81,6 +82,7 @@ public:
                return _video_container_size;
        }
 
+       void set_playback_length (dcpomatic::DCPTime len);
        void set_video_container_size (dcp::Size);
        void set_ignore_video ();
        void set_ignore_audio ();
index cac6e8c28aebbb4687d5c21b3164c419b129be9f..bb59122aaff0605f5c46b89625ffe607950b2f2c 100644 (file)
@@ -406,6 +406,7 @@ void
 FilmViewer::film_length_change ()
 {
        _video_view->set_length (_film->length());
+       _player->set_playback_length (_film->length());
 }
 
 /** Re-get the current frame slowly by seeking */