+ _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)
+{
+ auto 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(TextType::OPEN_SUBTITLE),
+ (*_reel)->main_subtitle()->entry_point().get_value_or(0),
+ *decoder,
+ size
+ );
+ ++decoder;
+ }
+
+ for (auto i: (*_reel)->closed_captions()) {
+ pass_texts (
+ next, i->asset(), _dcp_content->reference_text(TextType::CLOSED_CAPTION), i->entry_point().get_value_or(0), *decoder, size
+ );
+ ++decoder;
+ }
+}
+
+void
+DCPDecoder::pass_texts (
+ ContentTime next, shared_ptr<dcp::SubtitleAsset> asset, bool reference, int64_t entry_point, shared_ptr<TextDecoder> decoder, dcp::Size size
+ )
+{
+ double const vfr = _dcp_content->active_video_frame_rate (film());
+ /* Frame within the (played part of the) reel that is coming up next */
+ int64_t const frame = next.frames_round (vfr);
+
+ if (_decode_referenced || !reference) {
+ auto subs = asset->subtitles_during (