Fix finding of subtitles when clicking in the list view.
authorCarl Hetherington <cth@carlh.net>
Fri, 13 Nov 2020 16:37:08 +0000 (17:37 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 13 Nov 2020 16:37:08 +0000 (17:37 +0100)
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.

src/wx/text_view.cc

index 66c1446285e5f8cf6cd60859cb737552971d9ba9..491df7b3b9693c16cca8313ea1f1a5d739bdfc79 100644 (file)
@@ -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);
 }