Fix initial display of a new piece of content.
authorCarl Hetherington <cth@carlh.net>
Thu, 17 Oct 2013 14:55:31 +0000 (15:55 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 17 Oct 2013 14:55:31 +0000 (15:55 +0100)
src/lib/player.cc
src/lib/player.h
src/tools/dcpomatic.cc
src/wx/film_viewer.cc

index a235d16229bdd616303eb0df3ea02b07f34b1d65..f792655586362cac6b637e91358be4f2dd0ebfd6 100644 (file)
@@ -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;
 }
index 5604d8e0350c967f09cd33bfaf1a66ae77e62c29..7cce7e7237fd204690c1d246263f06a36656bcd8 100644 (file)
@@ -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.
index a4e4e8b75c177bcaa952c8c9401ed3f34980de5f..5df51392148b327baf20a7d5333a41c4c860e55b 100644 (file)
@@ -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<wxMenuItem*, int>::iterator j = menu_items.begin(); j != menu_items.end(); ++j) {
 
index 291ab422d82574bf357988d237efaf1b0aed4443..945644fb1ede92c74131d721a283237d5897bba4 100644 (file)
@@ -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 ();
 }