X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fcaption_view.cc;h=e6e63efffdcf862be274b590ed6b4100ee715612;hb=cbd4450197a083bf58bda510e626f73ba583cb66;hp=c57f9161e5cce2e4b16a38635403644a3983e9a6;hpb=5008f986d2d9d5891919d2db4de6268470a0ff7a;p=dcpomatic.git diff --git a/src/wx/caption_view.cc b/src/wx/caption_view.cc index c57f9161e..e6e63efff 100644 --- a/src/wx/caption_view.cc +++ b/src/wx/caption_view.cc @@ -35,7 +35,7 @@ using boost::shared_ptr; using boost::bind; using boost::dynamic_pointer_cast; -CaptionView::CaptionView (wxWindow* parent, shared_ptr film, shared_ptr content, shared_ptr decoder, FilmViewer* viewer) +CaptionView::CaptionView (wxWindow* parent, shared_ptr film, shared_ptr content, shared_ptr caption, shared_ptr decoder, FilmViewer* viewer) : wxDialog (parent, wxID_ANY, _("Captions"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) , _content (content) , _film_viewer (viewer) @@ -85,8 +85,14 @@ CaptionView::CaptionView (wxWindow* parent, shared_ptr film, shared_ptractive_frame_rate_change (content->position()); - decoder->caption->PlainStart.connect (bind (&CaptionView::data_start, this, _1)); - decoder->caption->Stop.connect (bind (&CaptionView::data_stop, this, _1)); + + /* Find the decoder that is being used for our CaptionContent and attach to it */ + BOOST_FOREACH (shared_ptr i, decoder->caption) { + if (i->content() == caption) { + i->PlainStart.connect (bind (&CaptionView::data_start, this, _1)); + i->Stop.connect (bind (&CaptionView::data_stop, this, _1)); + } + } while (!decoder->pass ()) {} SetSizerAndFit (sizer); }