summaryrefslogtreecommitdiff
path: root/src/sound_asset.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-08-02 18:23:36 +0200
committerCarl Hetherington <cth@carlh.net>2024-08-02 18:23:36 +0200
commit7d9e108ba3629b2e9120bc1da3354935c41aca37 (patch)
treec8ffdb2bca75d62bfe9fa2262e9fc4cd19c45027 /src/sound_asset.cc
parent6f98afd8021f9475bbd342bdcb39162b3167fa9e (diff)
WIP: more hacks.shared-ptr
Diffstat (limited to 'src/sound_asset.cc')
-rw-r--r--src/sound_asset.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/sound_asset.cc b/src/sound_asset.cc
index c73255b8..d36db241 100644
--- a/src/sound_asset.cc
+++ b/src/sound_asset.cc
@@ -217,15 +217,15 @@ SoundAsset::equals(shared_ptr<const Asset> other, EqualityOptions const& opt, No
auto frame_A = reader->get_frame (i);
auto frame_B = other_reader->get_frame (i);
- if (frame_A->size() != frame_B->size()) {
+ if (frame_A.size() != frame_B.size()) {
note (NoteType::ERROR, String::compose ("sizes of audio data for frame %1 differ", i));
return false;
}
- if (memcmp (frame_A->data(), frame_B->data(), frame_A->size()) != 0) {
- for (int sample = 0; sample < frame_A->samples(); ++sample) {
- for (int channel = 0; channel < frame_A->channels(); ++channel) {
- int32_t const d = abs(frame_A->get(channel, sample) - frame_B->get(channel, sample));
+ if (memcmp(frame_A.data(), frame_B.data(), frame_A.size()) != 0) {
+ for (int sample = 0; sample < frame_A.samples(); ++sample) {
+ for (int channel = 0; channel < frame_A.channels(); ++channel) {
+ int32_t const d = abs(frame_A.get(channel, sample) - frame_B.get(channel, sample));
if (d > opt.max_audio_sample_error) {
note (NoteType::ERROR, String::compose("PCM data difference of %1 in frame %2, channel %3, sample %4", d, i, channel, sample));
return false;