summaryrefslogtreecommitdiff
path: root/src/dcp.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-07-31 01:01:19 +0100
committerCarl Hetherington <cth@carlh.net>2012-07-31 01:01:19 +0100
commitda2f0d96f3c5ffa73bfecd9df613b23200e862f7 (patch)
tree326e054f9b2dc39e0d276e6bdf2a572dbf324ecc /src/dcp.cc
parent4678bf06d71c8a18c489912dabf8aca312ab8b6b (diff)
Bitwise MXF comparison.
Diffstat (limited to 'src/dcp.cc')
-rw-r--r--src/dcp.cc21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/dcp.cc b/src/dcp.cc
index dc895e11..ed63170f 100644
--- a/src/dcp.cc
+++ b/src/dcp.cc
@@ -305,12 +305,11 @@ DCP::DCP (string directory)
}
list<string>
-DCP::equals (DCP const & other, EqualityType type) const
+DCP::equals (DCP const & other, EqualityFlags flags) const
{
list<string> notes;
- switch (type) {
- case LIBDCP_METADATA:
+ if (flags & LIBDCP_METADATA) {
if (_name != other._name) {
notes.push_back ("names differ");
}
@@ -323,10 +322,24 @@ DCP::equals (DCP const & other, EqualityType type) const
if (_length != other._length) {
notes.push_back ("lengths differ");
}
+ }
+
+ if (flags & LIBDCP_METADATA || flags & MXF_BITWISE) {
if (_assets.size() != other._assets.size()) {
notes.push_back ("asset counts differ");
}
- break;
+ }
+
+ 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;
+ }
}
return notes;