Merge master.
[dcpomatic.git] / src / lib / writer.cc
index 39b9b9304ff5a49a1d9b29f9f75d30fa38ca3eda..cbb84a94019bc0a97fc67abf14e05545ccaf4675 100644 (file)
@@ -18,6 +18,7 @@
 */
 
 #include <fstream>
+#include <cerrno>
 #include <libdcp/picture_asset.h>
 #include <libdcp/sound_asset.h>
 #include <libdcp/picture_frame.h>
@@ -27,7 +28,7 @@
 #include "writer.h"
 #include "compose.hpp"
 #include "film.h"
-#include "container.h"
+#include "ratio.h"
 #include "log.h"
 #include "dcp_video_frame.h"
 #include "dcp_content_type.h"
@@ -48,7 +49,7 @@ using boost::shared_ptr;
 
 int const Writer::_maximum_frames_in_memory = 8;
 
-Writer::Writer (shared_ptr<Film> f, shared_ptr<Job> j)
+Writer::Writer (shared_ptr<const Film> f, shared_ptr<Job> j)
        : _film (f)
        , _job (j)
        , _first_nonexistant_frame (0)
@@ -76,7 +77,7 @@ Writer::Writer (shared_ptr<Film> f, shared_ptr<Job> j)
                        _film->internal_video_mxf_dir (),
                        _film->internal_video_mxf_filename (),
                        _film->dcp_video_frame_rate (),
-                       _film->container()->dcp_size ()
+                       _film->container()->size (_film->full_frame ())
                        )
                );
 
@@ -342,8 +343,9 @@ Writer::check_existing_picture_mxf ()
        boost::filesystem::path p;
        p /= _film->internal_video_mxf_dir ();
        p /= _film->internal_video_mxf_filename ();
-       FILE* mxf = fopen (p.string().c_str(), N_("rb"));
+       FILE* mxf = fopen (p.string().c_str(), "rb");
        if (!mxf) {
+               _film->log()->log (String::compose ("Could not open existing MXF at %1 (errno=%2)", p.string(), errno));
                return;
        }