From db6827cee87a7331e2adc91a852d85dc73856f4d Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 17 Mar 2014 10:56:41 +0000 Subject: [PATCH] Improve behaviour of the position slider at the end of films. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reported-by: Gérald Maruccia --- ChangeLog | 2 ++ src/wx/film_viewer.cc | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 15aa8a87b..5a99d30ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2014-03-17 Carl Hetherington + * Improve behaviour of the position slider at the end of films. + * Version 1.66.2 released. 2014-03-17 Carl Hetherington 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 (); } } -- 2.30.2