+
+void
+Writer::check_existing_picture_mxf ()
+{
+ boost::filesystem::path p;
+ p /= _film->video_mxf_dir ();
+ p /= _film->video_mxf_filename ();
+ if (!boost::filesystem::exists (p)) {
+ return;
+ }
+
+ libdcp::MonoPictureAsset existing (_film->video_mxf_dir(), _film->video_mxf_filename());
+
+ while (_first_nonexistant_frame < existing.intrinsic_duration()) {
+
+ shared_ptr<const libdcp::MonoPictureFrame> f = existing.get_frame (_first_nonexistant_frame);
+ string const existing_hash = md5_digest (f->j2k_data(), f->j2k_size());
+
+ ifstream hf (_film->hash_path (_first_nonexistant_frame).c_str ());
+ string reference_hash;
+ hf >> reference_hash;
+
+ if (existing_hash != reference_hash) {
+ cout << "frame " << _first_nonexistant_frame << " failed hash check.\n";
+ break;
+ }
+
+ cout << "frame " << _first_nonexistant_frame << " ok.\n";
+ ++_first_nonexistant_frame;
+ }
+}
+