From db6827cee87a7331e2adc91a852d85dc73856f4d Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 17 Mar 2014 10:56:41 +0000 Subject: Improve behaviour of the position slider at the end of films. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported-by: Gérald Maruccia --- src/wx/film_viewer.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index 45372d811..ce5eab00e 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -219,7 +219,12 @@ void FilmViewer::slider_moved () { if (_film && _player) { - _player->seek (_slider->GetValue() * _film->length() / 4096, false); + 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 (t, false); fetch_next_frame (); } } -- cgit v1.2.3