diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-10-02 21:22:46 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-10-02 21:22:46 +0100 |
| commit | 0884b93386c0b6858eae0236d75a4eba12176219 (patch) | |
| tree | 796b180c677ae5b38807007ecf73e63271d5a00c /src | |
| parent | d174743763d6be234a8edf9774a6af9c7e8d0708 (diff) | |
Fix comparison of audio assets to not just compare the first frame.
Diffstat (limited to 'src')
| -rw-r--r-- | src/sound_asset.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/sound_asset.cc b/src/sound_asset.cc index a41e5b67..86ce69cf 100644 --- a/src/sound_asset.cc +++ b/src/sound_asset.cc @@ -201,13 +201,11 @@ SoundAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt) const if (opt.flags & MXF_INSPECT) { ASDCP::PCM::MXFReader reader_A; if (ASDCP_FAILURE (reader_A.OpenRead (path().string().c_str()))) { - cout << "failed " << path() << "\n"; throw MXFFileError ("could not open MXF file for reading", path().string()); } ASDCP::PCM::MXFReader reader_B; if (ASDCP_FAILURE (reader_B.OpenRead (other->path().string().c_str()))) { - cout << "failed " << other->path() << "\n"; throw MXFFileError ("could not open MXF file for reading", path().string()); } @@ -240,11 +238,11 @@ SoundAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt) const ASDCP::PCM::FrameBuffer buffer_B (1 * Kumu::Megabyte); for (int i = 0; i < _length; ++i) { - if (ASDCP_FAILURE (reader_A.ReadFrame (0, buffer_A))) { + if (ASDCP_FAILURE (reader_A.ReadFrame (i, buffer_A))) { throw DCPReadError ("could not read audio frame"); } - if (ASDCP_FAILURE (reader_B.ReadFrame (0, buffer_B))) { + if (ASDCP_FAILURE (reader_B.ReadFrame (i, buffer_B))) { throw DCPReadError ("could not read audio frame"); } @@ -254,7 +252,7 @@ SoundAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt) const } if (memcmp (buffer_A.RoData(), buffer_B.RoData(), buffer_A.Size()) != 0) { - notes.push_back ("PCM data for frame " + lexical_cast<string>(i) + " differ"); + notes.push_back ("PCM data for MXF frame " + lexical_cast<string>(i) + " differ"); continue; } } |
