Bump asdcplib to dcpomatic-2.13.0 branch.
[libdcp.git] / src / sound_asset.cc
index c31f8bf44cd173e7791bbbae676082cab8921e92..90075278566de02278843e2c9ff1e0ab69711022 100644 (file)
@@ -41,6 +41,7 @@
 #include "dcp_assert.h"
 #include "equality_options.h"
 #include "exceptions.h"
+#include "filesystem.h"
 #include "sound_asset.h"
 #include "sound_asset_reader.h"
 #include "sound_asset_writer.h"
@@ -69,8 +70,9 @@ using namespace dcp;
 SoundAsset::SoundAsset (boost::filesystem::path file)
        : Asset (file)
 {
-       ASDCP::PCM::MXFReader reader;
-       auto r = reader.OpenRead (file.string().c_str());
+       Kumu::FileReaderFactory factory;
+       ASDCP::PCM::MXFReader reader(factory);
+       auto r = reader.OpenRead(dcp::filesystem::fix_long_path(file).string().c_str());
        if (ASDCP_FAILURE(r)) {
                boost::throw_exception (MXFFileError("could not open MXF file for reading", file.string(), r));
        }
@@ -137,15 +139,16 @@ SoundAsset::equals(shared_ptr<const Asset> other, EqualityOptions const& opt, No
                return true;
        }
 
-       ASDCP::PCM::MXFReader reader_A;
+       Kumu::FileReaderFactory factory;
+       ASDCP::PCM::MXFReader reader_A(factory);
        DCP_ASSERT (file());
-       auto r = reader_A.OpenRead (file()->string().c_str());
+       auto r = reader_A.OpenRead(dcp::filesystem::fix_long_path(*file()).string().c_str());
        if (ASDCP_FAILURE(r)) {
                boost::throw_exception (MXFFileError("could not open MXF file for reading", file()->string(), r));
        }
 
-       ASDCP::PCM::MXFReader reader_B;
-       r = reader_B.OpenRead (other->file()->string().c_str());
+       ASDCP::PCM::MXFReader reader_B(factory);
+       r = reader_B.OpenRead(dcp::filesystem::fix_long_path(*other->file()).string().c_str());
        if (ASDCP_FAILURE (r)) {
                boost::throw_exception (MXFFileError("could not open MXF file for reading", other->file()->string(), r));
        }
@@ -277,8 +280,9 @@ SoundAsset::static_pkl_type (Standard standard)
 bool
 SoundAsset::valid_mxf (boost::filesystem::path file)
 {
-       ASDCP::PCM::MXFReader reader;
-       Kumu::Result_t r = reader.OpenRead (file.string().c_str());
+       Kumu::FileReaderFactory factory;
+       ASDCP::PCM::MXFReader reader(factory);
+       Kumu::Result_t r = reader.OpenRead(dcp::filesystem::fix_long_path(file).string().c_str());
        return !ASDCP_FAILURE (r);
 }