Hand-apply bd7102b476c631b1fa9067f18ce938d86073f6c8; single-file hashes.
[dcpomatic.git] / src / lib / encoded_data.cc
index 61d2644daf324dd251861dbfe686ff93e514dc31..4f8aaab4b5b6f62199884eb76855140cc34e0441 100644 (file)
@@ -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
@@ -21,6 +21,7 @@
 #include "cross.h"
 #include "exceptions.h"
 #include "film.h"
+#include "dcpomatic_socket.h"
 
 #include "i18n.h"
 
@@ -90,12 +91,14 @@ EncodedData::write (shared_ptr<const Film> film, int frame, Eyes eyes) const
 }
 
 void
-EncodedData::write_info (shared_ptr<const Film> film, int frame, Eyes eyes, dcp::FrameInfo fin) const
+EncodedData::write_info (shared_ptr<const Film> film, int frame, Eyes eyes, dcp::FrameInfo info) const
 {
-       boost::filesystem::path const info = film->info_path (frame, eyes);
-       FILE* h = fopen_boost (info, "w");
-       fin.write (h);
-       fclose (h);
+       FILE* file = fopen_boost (film->info_file(), "ab");
+       if (!file) {
+               throw OpenFileError (film->info_file ());
+       }
+       write_frame_info (file, frame, eyes, info);
+       fclose (file);
 }
 
 /** Send this data to a socket.