+ audio->emit (film(), _dcp_content->audio->stream(), data, ContentTime::from_frames (_offset, vfr) + _next);
+ }
+
+ _next += ContentTime::from_frames (1, vfr);
+
+ if ((*_reel)->main_picture ()) {
+ if (_next.frames_round (vfr) >= (*_reel)->main_picture()->duration()) {
+ next_reel ();
+ _next = ContentTime ();
+ }
+ }
+
+ return false;
+}
+
+void
+DCPDecoder::pass_texts (ContentTime next, dcp::Size size)
+{
+ list<shared_ptr<TextDecoder> >::const_iterator decoder = text.begin ();
+ if (decoder == text.end()) {
+ /* It's possible that there is now a main subtitle but no TextDecoders, for example if
+ the CPL has just changed but the TextContent's texts have not been recreated yet.
+ */
+ return;
+ }
+
+ if ((*_reel)->main_subtitle()) {
+ pass_texts (
+ next,
+ (*_reel)->main_subtitle()->asset(),
+ _dcp_content->reference_text(TEXT_OPEN_SUBTITLE),
+ (*_reel)->main_subtitle()->entry_point(),
+ *decoder,
+ size
+ );
+ ++decoder;
+ }
+
+ BOOST_FOREACH (shared_ptr<dcp::ReelClosedCaptionAsset> i, (*_reel)->closed_captions()) {
+ pass_texts (
+ next, i->asset(), _dcp_content->reference_text(TEXT_CLOSED_CAPTION), i->entry_point(), *decoder, size
+ );
+ ++decoder;