summaryrefslogtreecommitdiff
path: root/src/lib/writer.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-04-21 01:00:36 +0100
committerCarl Hetherington <cth@carlh.net>2015-04-21 01:00:36 +0100
commitff96cc9c9e33fbe9dea02ea2d397144f9c9ac8c9 (patch)
tree30182f6187bb2ac4df9499f9b64e42aa9ae862dc /src/lib/writer.cc
parent1a9453df58177ff006da99e9ef1ed77624aa7d42 (diff)
Hand-apply bd7102b476c631b1fa9067f18ce938d86073f6c8; single-file hashes.
Diffstat (limited to 'src/lib/writer.cc')
-rw-r--r--src/lib/writer.cc29
1 files changed, 11 insertions, 18 deletions
diff --git a/src/lib/writer.cc b/src/lib/writer.cc
index 909b1e448..e8a4ac10b 100644
--- a/src/lib/writer.cc
+++ b/src/lib/writer.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -189,12 +189,12 @@ Writer::fake_write (int frame, Eyes eyes)
_full_condition.wait (lock);
}
- FILE* ifi = fopen_boost (_film->info_path (frame, eyes), "r");
- if (!ifi) {
- throw ReadFileError (_film->info_path (frame, eyes));
+ FILE* file = fopen_boost (_film->info_file (), "rb");
+ if (!file) {
+ throw ReadFileError (_film->info_file ());
}
- dcp::FrameInfo info (ifi);
- fclose (ifi);
+ dcp::FrameInfo info = read_frame_info (file, frame, eyes);
+ fclose (file);
QueueItem qi;
qi.type = QueueItem::FAKE;
@@ -558,14 +558,14 @@ bool
Writer::check_existing_picture_mxf_frame (FILE* mxf, int f, Eyes eyes)
{
/* Read the frame info as written */
- FILE* ifi = fopen_boost (_film->info_path (f, eyes), "r");
- if (!ifi) {
+ FILE* file = fopen_boost (_film->info_file (), "rb");
+ if (!file) {
LOG_GENERAL ("Existing frame %1 has no info file", f);
return false;
}
- dcp::FrameInfo info (ifi);
- fclose (ifi);
+ dcp::FrameInfo info = read_frame_info (file, f, eyes);
+ fclose (file);
if (info.size == 0) {
LOG_GENERAL ("Existing frame %1 has no info file", f);
return false;
@@ -603,19 +603,12 @@ Writer::check_existing_picture_mxf ()
return;
}
- int N = 0;
- for (boost::filesystem::directory_iterator i (_film->info_dir ()); i != boost::filesystem::directory_iterator (); ++i) {
- ++N;
- }
-
while (true) {
shared_ptr<Job> job = _job.lock ();
DCPOMATIC_ASSERT (job);
- if (N > 0) {
- job->set_progress (float (_first_nonexistant_frame) / N);
- }
+ job->set_progress_unknown ();
if (_film->three_d ()) {
if (!check_existing_picture_mxf_frame (mxf, _first_nonexistant_frame, EYES_LEFT)) {