From aedc1d5c8db3a77bd6b2cbba8461ce8df5c9ae39 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 17 Oct 2013 15:55:31 +0100 Subject: [PATCH 1/1] Fix initial display of a new piece of content. --- src/lib/player.cc | 10 +++++++--- src/lib/player.h | 2 +- src/tools/dcpomatic.cc | 2 +- src/wx/film_viewer.cc | 5 ++++- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/lib/player.cc b/src/lib/player.cc index a235d1622..f79265558 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -616,12 +616,14 @@ Player::update_subtitle () _out_subtitle.to = _in_subtitle.to + piece->content->position (); } -/** Re-emit the last frame that was emitted, using current settings for crop, ratio, scaler and subtitles */ -void +/** Re-emit the last frame that was emitted, using current settings for crop, ratio, scaler and subtitles. + * @return false if this could not be done. + */ +bool Player::repeat_last_video () { if (!_last_process_video.image) { - return; + return false; } process_video ( @@ -631,4 +633,6 @@ Player::repeat_last_video () _last_process_video.same, _last_process_video.frame ); + + return true; } diff --git a/src/lib/player.h b/src/lib/player.h index 5604d8e03..7cce7e723 100644 --- a/src/lib/player.h +++ b/src/lib/player.h @@ -59,7 +59,7 @@ public: void set_video_container_size (libdcp::Size); - void repeat_last_video (); + bool repeat_last_video (); /** Emitted when a video frame is ready. * First parameter is the video image. diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index a4e4e8b75..5df513921 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -149,7 +149,7 @@ set_menu_sensitivity () ++i; } bool const dcp_creation = (i != jobs.end ()); - bool const have_dcp = !film->dcps().empty (); + bool const have_dcp = film && !film->dcps().empty (); for (map::iterator j = menu_items.begin(); j != menu_items.end(); ++j) { diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index 291ab422d..945644fb1 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -150,7 +150,10 @@ FilmViewer::fetch_current_frame_again () */ _got_frame = false; - _player->repeat_last_video (); + if (!_player->repeat_last_video ()) { + fetch_next_frame (); + } + _panel->Refresh (); _panel->Update (); } -- 2.30.2