Merge branch 'master' of ssh://git.carlh.net/home/carl/git/dcpomatic
[dcpomatic.git] / src / lib / writer.cc
index b4655baf98ff46af6181a079b3d68a5bda3c327c..4b5c5a1023a6cc164c70bc8a8d791e68fe501e07 100644 (file)
@@ -96,7 +96,7 @@ Writer::Writer (shared_ptr<const Film> film, weak_ptr<Job> j)
        */
        _audio_reel = _reels.begin ();
        for (int i = 0; i < TEXT_COUNT; ++i) {
-               _caption_reel[i] = _reels.begin ();
+               _text_reel[i] = _reels.begin ();
        }
 
        /* Check that the signer is OK if we need one */
@@ -435,7 +435,7 @@ try
                        DCPOMATIC_ASSERT (i != _queue.rend());
                        ++_pushed_to_disk;
                        /* For the log message below */
-                       int const awaiting = _reels[_queue.front().reel].last_written_video_frame();
+                       int const awaiting = _reels[_queue.front().reel].last_written_video_frame() + 1;
                        lock.unlock ();
 
                        /* i is valid here, even though we don't hold a lock on the mutex,
@@ -667,14 +667,14 @@ Writer::can_fake_write (Frame frame) const
 void
 Writer::write (PlayerText text, TextType type, DCPTimePeriod period)
 {
-       while (_caption_reel[type]->period().to <= period.from) {
-               ++_caption_reel[type];
-               DCPOMATIC_ASSERT (_caption_reel[type] != _reels.end());
+       while (_text_reel[type]->period().to <= period.from) {
+               ++_text_reel[type];
+               DCPOMATIC_ASSERT (_text_reel[type] != _reels.end());
        }
 
-       DCPOMATIC_ASSERT (_caption_reel[type] != _reels.end());
+       DCPOMATIC_ASSERT (_text_reel[type] != _reels.end());
 
-       _caption_reel[type]->write (text, type, period);
+       _text_reel[type]->write (text, type, period);
 }
 
 void