Fix finding of subtitles when clicking in the list view.
[dcpomatic.git] / src / wx / text_view.cc
index 9b591b19161406408c88bef739a4c4323a1f91d0..491df7b3b9693c16cca8313ea1f1a5d739bdfc79 100644 (file)
@@ -35,6 +35,10 @@ using boost::shared_ptr;
 using boost::weak_ptr;
 using boost::bind;
 using boost::dynamic_pointer_cast;
+using namespace dcpomatic;
+#if BOOST_VERSION >= 106100
+using namespace boost::placeholders;
+#endif
 
 TextView::TextView (
        wxWindow* parent, shared_ptr<Film> film, shared_ptr<Content> content, shared_ptr<TextContent> text, shared_ptr<Decoder> decoder, weak_ptr<FilmViewer> viewer
@@ -140,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);
 }