/*
- 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
#include "cross.h"
#include "exceptions.h"
#include "film.h"
+#include "dcpomatic_socket.h"
#include "i18n.h"
}
+EncodedData::EncodedData (uint8_t const * d, int s)
+ : _data (new uint8_t[s])
+ , _size (s)
+{
+ memcpy (_data, d, s);
+}
+
EncodedData::EncodedData (boost::filesystem::path file)
{
_size = boost::filesystem::file_size (file);
}
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.