Tweak.
authorCarl Hetherington <cth@carlh.net>
Tue, 31 Jul 2012 09:37:56 +0000 (10:37 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 31 Jul 2012 09:37:56 +0000 (10:37 +0100)
src/asset.cc
src/asset.h
src/dcp.cc
src/types.h

index 13f8bf70b9251ca4ac124d8559a54ef700b6ad41..4b02774c3f68e6945647c253fc8d09d85262727b 100644 (file)
@@ -96,33 +96,33 @@ Asset::mxf_path () const
 }
 
 list<string>
-Asset::equals (Asset const & other, EqualityFlags flags) const
+Asset::equals (shared_ptr<const Asset> other, EqualityFlags flags) const
 {
        list<string> notes;
        
        if (flags & LIBDCP_METADATA) {
-               if (_mxf_name != other._mxf_name) {
+               if (_mxf_name != other->_mxf_name) {
                        notes.push_back ("MXF names differ");
                }
-               if (_fps != other._fps) {
+               if (_fps != other->_fps) {
                        notes.push_back ("MXF frames per second differ");
                }
-               if (_length != other._length) {
+               if (_length != other->_length) {
                        notes.push_back ("MXF lengths differ");
                }
-               if (_digest != other._digest) {
+               if (_digest != other->_digest) {
                        notes.push_back ("MXF digests differ");
                }
        }
        
        if (flags & MXF_BITWISE) {
-               if (filesystem::file_size (mxf_path()) != filesystem::file_size (other.mxf_path())) {
-                       notes.push_back (mxf_path().string() + " and " + other.mxf_path().string() + " sizes differ");
+               if (filesystem::file_size (mxf_path()) != filesystem::file_size (other->mxf_path())) {
+                       notes.push_back (mxf_path().string() + " and " + other->mxf_path().string() + " sizes differ");
                        return notes;
                }
                
                ifstream a (mxf_path().c_str(), ios::binary);
-               ifstream b (other.mxf_path().c_str(), ios::binary);
+               ifstream b (other->mxf_path().c_str(), ios::binary);
 
                int buffer_size = 65536;
                char abuffer[buffer_size];
@@ -137,7 +137,7 @@ Asset::equals (Asset const & other, EqualityFlags flags) const
 
                        for (int i = 0; i < t; ++i) {
                                if (abuffer[i] != bbuffer[i]) {
-                                       notes.push_back (mxf_path().string() + " and " + other.mxf_path().string() + " content differs");
+                                       notes.push_back (mxf_path().string() + " and " + other->mxf_path().string() + " content differs");
                                        return notes;
                                }
                        }
@@ -146,5 +146,9 @@ Asset::equals (Asset const & other, EqualityFlags flags) const
                }
        }
 
+       if (flags & MXF_INSPECT) {
+
+       }
+
        return notes;
 }
index 7fb0ece28d610ac15896bc7928ea496b6220c64f..4d26a4bc83fc3930ae98cf50ba15877320441d8c 100644 (file)
@@ -66,7 +66,7 @@ public:
         */
        void write_to_assetmap (std::ostream& s) const;
 
-       std::list<std::string> equals (Asset const & other, EqualityFlags flags) const;
+       std::list<std::string> equals (boost::shared_ptr<const Asset> other, EqualityFlags flags) const;
 
 protected:
        /** Fill in a ADSCP::WriteInfo struct.
index 67c56f99b8deaf7c3b7a93a2996b073812e65f4c..6b834a703a61ebab7bb756da9c7cd539e9d6ab78 100644 (file)
@@ -332,7 +332,7 @@ DCP::equals (DCP const & other, EqualityFlags flags) const
        list<shared_ptr<Asset> >::const_iterator b = other._assets.begin ();
        
        while (a != _assets.end ()) {
-               list<string> n = (*a)->equals (*b->get(), flags);
+               list<string> n = (*a)->equals (*b, flags);
                notes.merge (n);
                ++a;
                ++b;
index ad14094dfb65b7f31d175ae36ed506db93e7b298..019f93a783f2a88b3c31f99e070d9839f2580f21 100644 (file)
@@ -64,7 +64,8 @@ public:
 
 enum EqualityFlags {
        LIBDCP_METADATA = 0x1,
-       MXF_BITWISE = 0x2
+       MXF_BITWISE = 0x2,
+       MXF_INSPECT
 };
 
 }