diff options
| -rw-r--r-- | src/asset.cc | 20 | ||||
| -rw-r--r-- | src/dcp.cc | 26 | ||||
| -rw-r--r-- | src/picture_asset.cc | 2 | ||||
| -rw-r--r-- | src/sound_asset.cc | 2 |
4 files changed, 29 insertions, 21 deletions
diff --git a/src/asset.cc b/src/asset.cc index 86bd54c5..13f8bf70 100644 --- a/src/asset.cc +++ b/src/asset.cc @@ -100,10 +100,22 @@ Asset::equals (Asset const & other, EqualityFlags flags) const { list<string> notes; - switch (flags) { - case LIBDCP_METADATA: - break; - case MXF_BITWISE: + if (flags & LIBDCP_METADATA) { + if (_mxf_name != other._mxf_name) { + notes.push_back ("MXF names differ"); + } + if (_fps != other._fps) { + notes.push_back ("MXF frames per second differ"); + } + if (_length != other._length) { + notes.push_back ("MXF lengths differ"); + } + 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"); return notes; @@ -324,22 +324,18 @@ DCP::equals (DCP const & other, EqualityFlags flags) const } } - if (flags & LIBDCP_METADATA || flags & MXF_BITWISE) { - if (_assets.size() != other._assets.size()) { - notes.push_back ("asset counts differ"); - } + if (_assets.size() != other._assets.size()) { + notes.push_back ("asset counts differ"); } - - if (flags & MXF_BITWISE) { - list<shared_ptr<Asset> >::const_iterator a = _assets.begin (); - list<shared_ptr<Asset> >::const_iterator b = other._assets.begin (); - - while (a != _assets.end ()) { - list<string> n = (*a)->equals (*b->get(), MXF_BITWISE); - notes.merge (n); - ++a; - ++b; - } + + list<shared_ptr<Asset> >::const_iterator a = _assets.begin (); + list<shared_ptr<Asset> >::const_iterator b = other._assets.begin (); + + while (a != _assets.end ()) { + list<string> n = (*a)->equals (*b->get(), flags); + notes.merge (n); + ++a; + ++b; } return notes; diff --git a/src/picture_asset.cc b/src/picture_asset.cc index db3f02c3..7ff525b9 100644 --- a/src/picture_asset.cc +++ b/src/picture_asset.cc @@ -73,7 +73,7 @@ PictureAsset::PictureAsset (string directory, string mxf_name, int fps, int leng , _width (width) , _height (height) { - + _digest = make_digest (mxf_path().string(), 0); } string diff --git a/src/sound_asset.cc b/src/sound_asset.cc index e22357fd..34508d5b 100644 --- a/src/sound_asset.cc +++ b/src/sound_asset.cc @@ -55,7 +55,7 @@ SoundAsset::SoundAsset (string directory, string mxf_name, int fps, int length) : Asset (directory, mxf_name, 0, fps, length) , _channels (0) { - + _digest = make_digest (mxf_path().string(), 0); } string |
