Check for end of film when doing forward-frame.
authorCarl Hetherington <cth@carlh.net>
Tue, 28 Jul 2015 15:57:39 +0000 (16:57 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 28 Jul 2015 15:57:39 +0000 (16:57 +0100)
ChangeLog
src/wx/film_viewer.cc

index b0d7898dce883bb00613ac2e417f45b86ddb37b2..6628ef45461a09cb42463aeb1be850dc3d8d1107 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2015-07-28  c.hetherington  <cth@carlh.net>
 
+       * Stop forward-frame button going off the end of the film.
+
        * Notice when content is modified and offer to save the project
        on closing DCP-o-matic.
 
index 6f29bcc33b4b40cb045d59067e7d093ba156557f..1badc0282fc2258edb1c77f22867147e96fefc74 100644 (file)
@@ -418,7 +418,12 @@ FilmViewer::back_clicked ()
 void
 FilmViewer::forward_clicked ()
 {
-       get (_position + DCPTime::from_frames (1, _film->video_frame_rate ()), true);
+       DCPTime p = _position + DCPTime::from_frames (1, _film->video_frame_rate ());
+       if (p >= _film->length ()) {
+               p = _position;
+       }
+
+       get (p, true);
        update_position_label ();
        update_position_slider ();
 }