summaryrefslogtreecommitdiff
path: root/src/asset.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-07-31 11:33:19 +0100
committerCarl Hetherington <cth@carlh.net>2012-07-31 11:33:19 +0100
commit43175d3a567c1cc00bb1c672da3d6b2ffa4a4602 (patch)
treefec8b07b06da821a5cabfa6a12cdf5c262498920 /src/asset.cc
parentaaa33afbc17d60f9e836b4a2ad2e7ec2c294b837 (diff)
Inspect J2K data in MXFs.
Diffstat (limited to 'src/asset.cc')
-rw-r--r--src/asset.cc20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/asset.cc b/src/asset.cc
index 4b02774c..8063603a 100644
--- a/src/asset.cc
+++ b/src/asset.cc
@@ -110,12 +110,14 @@ Asset::equals (shared_ptr<const Asset> other, EqualityFlags flags) const
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 (_digest != other->_digest) {
+ notes.push_back ("MXF digests 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;
@@ -135,20 +137,14 @@ Asset::equals (shared_ptr<const Asset> other, EqualityFlags flags) const
a.read (abuffer, t);
b.read (bbuffer, t);
- 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");
- return notes;
- }
+ if (memcmp (abuffer, bbuffer, t) != 0) {
+ notes.push_back (mxf_path().string() + " and " + other->mxf_path().string() + " content differs");
+ return notes;
}
n -= t;
}
}
- if (flags & MXF_INSPECT) {
-
- }
-
return notes;
}