diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-10-03 11:00:30 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-10-03 11:00:30 +0100 |
| commit | aa81915df29d59ac69276a23ce68e599cae64e70 (patch) | |
| tree | 238efa37c010922a20c14249cd3d371f216ba2d8 /src/sound_asset.cc | |
| parent | ec7448895a77f67189e775c8eb0365cc3d636780 (diff) | |
Allow some error in audio when comparing.
Diffstat (limited to 'src/sound_asset.cc')
| -rw-r--r-- | src/sound_asset.cc | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/sound_asset.cc b/src/sound_asset.cc index 9f27a894..833d89dc 100644 --- a/src/sound_asset.cc +++ b/src/sound_asset.cc @@ -254,16 +254,13 @@ 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)); + if (d > opt.max_audio_sample_error) { + notes.push_back ("PCM data difference of " + lexical_cast<string> (d)); return false; } } - return false; } } |
