summaryrefslogtreecommitdiff
path: root/src/wx/caption_view.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/wx/caption_view.cc')
-rw-r--r--src/wx/caption_view.cc12
1 files changed, 9 insertions, 3 deletions
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> film, shared_ptr<Content> content, shared_ptr<Decoder> decoder, FilmViewer* viewer)
+CaptionView::CaptionView (wxWindow* parent, shared_ptr<Film> film, shared_ptr<Content> content, shared_ptr<CaptionContent> caption, shared_ptr<Decoder> 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> film, shared_ptr<Co
_subs = 0;
_frc = film->active_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<CaptionDecoder> 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);
}