More seek tidying.
[dcpomatic.git] / src / lib / writer.cc
index e9f7ab582a8ed95b489859288e46f7cb11d63478..6601fb2fe69631ebbc2228f2ad7d1d51987bec11 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>
@@ -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)
@@ -88,7 +89,7 @@ Writer::Writer (shared_ptr<Film> f, shared_ptr<Job> j)
                        _film->dcp_audio_mxf_filename (),
                        _film->dcp_video_frame_rate (),
                        _film->dcp_audio_channels (),
-                       _film->dcp_audio_frame_rate()
+                       _film->dcp_audio_frame_rate ()
                        )
                );
        
@@ -133,7 +134,6 @@ Writer::fake_write (int frame)
 void
 Writer::write (shared_ptr<const AudioBuffers> audio)
 {
-       cout << "W: audio " << audio->frames() << "\n";
        _sound_asset_writer->write (audio->data(), audio->frames());
 }
 
@@ -343,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;
        }