summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-10-03 00:16:29 +0100
committerCarl Hetherington <cth@carlh.net>2012-10-03 00:16:29 +0100
commitec7448895a77f67189e775c8eb0365cc3d636780 (patch)
tree5c82530aafaaa200cd8099787c1acd2623507f2b /src
parent19133069634100e119a1196c2f203af464145517 (diff)
Note first difference on an audio equals() discrepancy.
Diffstat (limited to 'src')
-rw-r--r--src/sound_asset.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sound_asset.cc b/src/sound_asset.cc
index 7a3d4415..9f27a894 100644
--- a/src/sound_asset.cc
+++ b/src/sound_asset.cc
@@ -255,6 +255,14 @@ SoundAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, list<str
if (memcmp (buffer_A.RoData(), buffer_B.RoData(), buffer_A.Size()) != 0) {
notes.push_back ("PCM data for MXF frame " + lexical_cast<string>(i) + " differ");
+
+ for (uint32_t i = 0; i < buffer_A.Size(); ++i) {
+ int const d = abs (buffer_A.RoData()[i] - buffer_B.RoData()[i]);
+ if (d) {
+ notes.push_back ("First difference is " + lexical_cast<string> (d));
+ return false;
+ }
+ }
return false;
}
}