Fix write_frame_info again.
authorCarl Hetherington <cth@carlh.net>
Sat, 22 Aug 2015 14:43:05 +0000 (15:43 +0100)
committerCarl Hetherington <cth@carlh.net>
Sat, 22 Aug 2015 14:43:05 +0000 (15:43 +0100)
src/lib/writer.cc

index 19030430036d439a3f772efc9af690118027d5ae..053c18451aec1498091c48ea59ad23ab0251c76a 100644 (file)
@@ -294,7 +294,12 @@ Writer::have_sequenced_image_at_queue_head ()
 void
 Writer::write_frame_info (int frame, Eyes eyes, dcp::FrameInfo info) const
 {
-       FILE* file = fopen_boost (_film->info_file(), "r+b");
+       FILE* file = 0;
+       if (boost::filesystem::exists (_film->info_file ())) {
+               file = fopen_boost (_film->info_file(), "r+b");
+       } else {
+               file = fopen_boost (_film->info_file(), "wb");
+       }
        if (!file) {
                throw OpenFileError (_film->info_file ());
        }