summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-04-02 00:58:53 +0100
committerCarl Hetherington <cth@carlh.net>2019-04-02 00:58:53 +0100
commitd5c8fb9b826aaac2acab58f8a7b2eec4fcce99a6 (patch)
tree1d0725918d6b2fa9071b5bd87528cb90b67a136a
parentfa63eaf05997ffed9fcd502331aa09dfb570ebb7 (diff)
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).
-rw-r--r--src/wx/controls.cc8
1 files changed, 6 insertions, 2 deletions
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 (