Fix glitchness at the start by not seeking to -ve times.
authorCarl Hetherington <cth@carlh.net>
Sun, 14 Jul 2013 21:07:34 +0000 (22:07 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 14 Jul 2013 21:07:34 +0000 (22:07 +0100)
src/wx/film_viewer.cc

index b50cb745111f88f79de88f2db2529760f743f020..cb5e6b4c2003063fd20060c963982b417c23a47d 100644 (file)
@@ -145,8 +145,13 @@ FilmViewer::fetch_current_frame_again ()
        /* Player::video_position is the time after the last frame that we received.
           We want to see it again, so seek back one frame.
        */
        /* Player::video_position is the time after the last frame that we received.
           We want to see it again, so seek back one frame.
        */
-          
-       _player->seek (_player->video_position() - _film->video_frames_to_time(1), true);
+
+       Time p = _player->video_position() - _film->video_frames_to_time (1);
+       if (p < 0) {
+               p = 0;
+       }
+
+       _player->seek (p, true);
        fetch_next_frame ();
 }
 
        fetch_next_frame ();
 }