From 86102d30bf0aad89115bbeb3d8aaa2a27a0aa432 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 23 Apr 2020 01:40:56 +0200 Subject: [PATCH] Fix complete failure of preview/playback introduced in 4219d4b76c5cd5690b1f4fa0c248d93ced26d05a. --- src/lib/player.cc | 11 +++++++++++ src/lib/player.h | 2 ++ src/wx/film_viewer.cc | 1 + 3 files changed, 14 insertions(+) diff --git a/src/lib/player.cc b/src/lib/player.cc index ab05d42ad..07447d531 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -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 film, shared_ptr 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 content) { diff --git a/src/lib/player.h b/src/lib/player.h index 5a1b08ecf..82344604c 100644 --- a/src/lib/player.h +++ b/src/lib/player.h @@ -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 (); diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index cac6e8c28..bb59122aa 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -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 */ -- 2.30.2