Merge master.
[dcpomatic.git] / src / wx / film_viewer.cc
index 7e1b618119eec5367b0374fa09239886a3f12181..b0bc65750f71ea8e202d973a07792a858c814c13 100644 (file)
@@ -222,6 +222,11 @@ FilmViewer::slider_moved ()
 {
        if (_film && _player) {
                try {
+                       Time t = _slider->GetValue() * _film->length() / 4096;
+                       /* Ensure that we hit the end of the film at the end of the slider */
+                       if (t >= _film->length ()) {
+                               t = _film->length() - _film->video_frames_to_time (1);
+                       }
                        _player->seek (DCPTime (_film->length().get() * _slider->GetValue() / 4096), false);
                        fetch_next_frame ();
                } catch (OpenFileError& e) {