From: Carl Hetherington Date: Mon, 1 Apr 2019 23:58:53 +0000 (+0100) Subject: Try to fix strange behaviour of the preview slider towards the end X-Git-Tag: v2.13.142~5 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=d5c8fb9b826aaac2acab58f8a7b2eec4fcce99a6;hp=fa63eaf05997ffed9fcd502331aa09dfb570ebb7;p=dcpomatic.git Try to fix strange behaviour of the preview slider towards the end of content where there is a section at the end with no keyframe (#1522). --- diff --git a/src/wx/controls.cc b/src/wx/controls.cc index 3e0666460..473ad8cb3 100644 --- a/src/wx/controls.cc +++ b/src/wx/controls.cc @@ -208,11 +208,15 @@ Controls::slider_moved (bool page) DCPTime t (_slider->GetValue() * _film->length().get() / 4096); t = t.round (_film->video_frame_rate()); - /* Ensure that we hit the end of the film at the end of the slider */ + /* Ensure that we hit the end of the film at the end of the slider. In particular, we + need to do an accurate seek in case there isn't a keyframe near the end. + */ + bool accurate = false; if (t >= _film->length ()) { t = _film->length() - _viewer->one_video_frame(); + accurate = true; } - _viewer->seek (t, false); + _viewer->seek (t, accurate); update_position_label (); log (