X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Flib%2Fwriter.cc;h=ea4a6d29beab4616dde6f4ff423b7b29d47ce050;hp=2eec8110e3112c1a2548eb125b541c743af61c2d;hb=9cb73fbc0fa4643612f01665bc6d9fc430656f32;hpb=54ef3f25f924a677de0d71e1f773898b56ab5852 diff --git a/src/lib/writer.cc b/src/lib/writer.cc index 2eec8110e..ea4a6d29b 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -91,11 +91,13 @@ Writer::Writer (shared_ptr film, weak_ptr j) _reels.push_back (ReelWriter (film, p, job, reel_index++, reels.size(), _film->content_summary(p))); } - /* We can keep track of the current audio and subtitle reels easily because audio - and subs arrive to the Writer in sequence. This is not so for video. + /* We can keep track of the current audio, subtitle and closed caption reels easily because audio + and captions arrive to the Writer in sequence. This is not so for video. */ _audio_reel = _reels.begin (); - _subtitle_reel = _reels.begin (); + for (int i = 0; i < TEXT_COUNT; ++i) { + _text_reel[i] = _reels.begin (); + } /* Check that the signer is OK if we need one */ string reason; @@ -663,16 +665,16 @@ Writer::can_fake_write (Frame frame) const } void -Writer::write (PlayerSubtitles subs, DCPTimePeriod period) +Writer::write (PlayerCaption text, TextType type, DCPTimePeriod period) { - while (_subtitle_reel->period().to <= period.from) { - ++_subtitle_reel; - DCPOMATIC_ASSERT (_subtitle_reel != _reels.end()); + while (_text_reel[type]->period().to <= period.from) { + ++_text_reel[type]; + DCPOMATIC_ASSERT (_text_reel[type] != _reels.end()); } - DCPOMATIC_ASSERT (_subtitle_reel != _reels.end()); + DCPOMATIC_ASSERT (_text_reel[type] != _reels.end()); - _subtitle_reel->write (subs, period); + _text_reel[type]->write (text, type, period); } void