summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-11-13 17:37:08 +0100
committerCarl Hetherington <cth@carlh.net>2020-11-13 17:37:08 +0100
commite38ce84e7e2ce3c468fa60ab7c23afc0000e98de (patch)
tree56c27dff9c58e6dbc8b39f71de4978297d840a31
parent862127345b39d9e581b75860460d95334ecd66e2 (diff)
Fix finding of subtitles when clicking in the list view.
I didn't look into this as deeply as I probably should have, but it seems there's some rounding error which means we don't always hit the subtitle's frame unless we add one on.
-rw-r--r--src/wx/text_view.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/wx/text_view.cc b/src/wx/text_view.cc
index 66c144628..491df7b3b 100644
--- a/src/wx/text_view.cc
+++ b/src/wx/text_view.cc
@@ -144,5 +144,6 @@ TextView::subtitle_selected (wxListEvent& ev)
DCPOMATIC_ASSERT (lc);
shared_ptr<FilmViewer> fv = _film_viewer.lock ();
DCPOMATIC_ASSERT (fv);
- fv->seek (lc, _start_times[ev.GetIndex()], true);
+ /* Add on a frame here to work around any rounding errors and make sure land in the subtitle */
+ fv->seek (lc, _start_times[ev.GetIndex()] + ContentTime::from_frames(1, _frc->source), true);
}