Make disabling forensic marking optional.
[libdcp.git] / src / sound_asset.cc
index 8abaae8fdd5c00bb1646bfbc25bb96d7ded601c3..74d412123803435de48e19d364ef5570f684cdb0 100644 (file)
 #include "sound_asset_writer.h"
 #include "sound_asset_reader.h"
 #include "compose.hpp"
-#include "KM_fileio.h"
-#include "AS_DCP.h"
 #include "dcp_assert.h"
+#include <asdcp/KM_fileio.h>
+#include <asdcp/AS_DCP.h>
 #include <libxml++/nodes/element.h>
 #include <boost/filesystem.hpp>
-#include <iostream>
 #include <stdexcept>
 
 using std::string;
-using std::stringstream;
-using std::ostream;
 using std::vector;
 using std::list;
 using boost::shared_ptr;
@@ -100,15 +97,16 @@ bool
 SoundAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, NoteHandler note) const
 {
        ASDCP::PCM::MXFReader reader_A;
-       Kumu::Result_t r = reader_A.OpenRead (file().string().c_str());
+       DCP_ASSERT (file ());
+       Kumu::Result_t r = reader_A.OpenRead (file()->string().c_str());
        if (ASDCP_FAILURE (r)) {
-               boost::throw_exception (MXFFileError ("could not open MXF file for reading", file().string(), 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());
+       r = reader_B.OpenRead (other->file()->string().c_str());
        if (ASDCP_FAILURE (r)) {
-               boost::throw_exception (MXFFileError ("could not open MXF file for reading", file().string(), r));
+               boost::throw_exception (MXFFileError ("could not open MXF file for reading", other->file()->string(), r));
        }
 
        ASDCP::PCM::AudioDescriptor desc_A;
@@ -203,7 +201,7 @@ SoundAsset::start_write (boost::filesystem::path file, Standard standard)
 shared_ptr<SoundAssetReader>
 SoundAsset::start_read () const
 {
-       return shared_ptr<SoundAssetReader> (new SoundAssetReader (this));
+       return shared_ptr<SoundAssetReader> (new SoundAssetReader (this, key ()));
 }
 
 string