Fix crazy thinko in Rect::extend() causing subtitles to disappear when they were...
[dcpomatic.git] / src / lib / writer.cc
index 10e4514fbcc134ef333d333d5086511b6b5660a3..d86a2ccf4ab032ba3a6d1f17ca232af7482bd02f 100644 (file)
@@ -106,6 +106,9 @@ void
 Writer::start ()
 {
        _thread = new boost::thread (boost::bind (&Writer::thread, this));
+#ifdef DCPOMATIC_LINUX
+       pthread_setname_np (_thread->native_handle(), "writer");
+#endif
 }
 
 Writer::~Writer ()
@@ -634,6 +637,11 @@ Writer::write_cover_sheet ()
 bool
 Writer::can_fake_write (Frame frame) const
 {
+       if (_film->encrypted()) {
+               /* We need to re-write the frame because the asset ID is embedded in the HMAC... I think... */
+               return false;
+       }
+
        /* We have to do a proper write of the first frame so that we can set up the JPEG2000
           parameters in the asset writer.
        */
@@ -656,6 +664,8 @@ Writer::write (PlayerSubtitles subs, DCPTimePeriod period)
                ++_subtitle_reel;
        }
 
+       DCPOMATIC_ASSERT (_subtitle_reel != _reels.end());
+
        _subtitle_reel->write (subs);
 }