From ec7448895a77f67189e775c8eb0365cc3d636780 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 3 Oct 2012 00:16:29 +0100 Subject: [PATCH] Note first difference on an audio equals() discrepancy. --- src/sound_asset.cc | 8 ++++++++ 1 file changed, 8 insertions(+) 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 other, EqualityOptions opt, list(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 (d)); + return false; + } + } return false; } } -- 2.30.2