summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-02-08 12:30:23 +0000
committerCarl Hetherington <cth@carlh.net>2013-02-08 12:30:23 +0000
commitc188b321ccda7972021b64017a3655be5f19f21e (patch)
tree7d9b4372c1e107c428b2f11dd030f7d5107cf727 /src
parenta6aabb8ecb5e6b99256f9474e521e5340e96931a (diff)
A couple of comments; tidy up logging.
Diffstat (limited to 'src')
-rw-r--r--src/lib/writer.cc22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/lib/writer.cc b/src/lib/writer.cc
index 563acc02d..1df8a4301 100644
--- a/src/lib/writer.cc
+++ b/src/lib/writer.cc
@@ -163,18 +163,6 @@ Writer::thread ()
--_queued_full_in_memory;
}
- switch (qi.type) {
- case QueueItem::FULL:
- ++_full_written;
- break;
- case QueueItem::FAKE:
- ++_fake_written;
- break;
- case QueueItem::REPEAT:
- ++_repeat_written;
- break;
- }
-
lock.unlock ();
switch (qi.type) {
case QueueItem::FULL:
@@ -186,18 +174,21 @@ Writer::thread ()
libdcp::FrameInfo const fin = _picture_asset_writer->write (qi.encoded->data(), qi.encoded->size());
qi.encoded->write_info (_film, qi.frame, fin);
_last_written = qi.encoded;
+ ++_full_written;
break;
}
case QueueItem::FAKE:
_film->log()->log (String::compose ("Writer FAKE-writes %1 to MXF", qi.frame));
_picture_asset_writer->fake_write (qi.size);
_last_written.reset ();
+ ++_fake_written;
break;
case QueueItem::REPEAT:
{
_film->log()->log (String::compose ("Writer REPEAT-writes %1 to MXF", qi.frame));
libdcp::FrameInfo const fin = _picture_asset_writer->write (_last_written->data(), _last_written->size());
_last_written->write_info (_film, qi.frame, fin);
+ ++_repeat_written;
break;
}
}
@@ -358,10 +349,15 @@ Writer::check_existing_picture_mxf ()
fclose (mxf);
}
-/** @return true if the fake write succeeded, otherwise false */
+/** @param frame Frame index.
+ * @return true if we can fake-write this frame.
+ */
bool
Writer::can_fake_write (int frame) const
{
+ /* We have to do a proper write of the first frame so that we can set up the JPEG2000
+ parameters in the MXF writer.
+ */
return (frame != 0 && frame < _first_nonexistant_frame);
}