Prevent frame back before time 0.
authorCarl Hetherington <cth@carlh.net>
Thu, 8 Aug 2013 19:51:02 +0000 (20:51 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 8 Aug 2013 19:51:02 +0000 (20:51 +0100)
src/wx/film_viewer.cc

index f569f4c54ae097a43c893cccff62f09689cfaeca..ddd6c12c569e8c9ed46706aa81e4108a5a256d32 100644 (file)
@@ -382,8 +382,13 @@ FilmViewer::back_clicked ()
        /* Player::video_position is the time after the last frame that we received.
           We want to see the one before it, so we need to go back 2.
        */
+
+       Time p = _player->video_position() - _film->video_frames_to_time (2);
+       if (p < 0) {
+               p = 0;
+       }
        
-       _player->seek (_player->video_position() - _film->video_frames_to_time(2), true);
+       _player->seek (p, true);
        fetch_next_frame ();
 }