diff options
Diffstat (limited to 'src/stereo_j2k_picture_asset.cc')
| -rw-r--r-- | src/stereo_j2k_picture_asset.cc | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/src/stereo_j2k_picture_asset.cc b/src/stereo_j2k_picture_asset.cc index 6a5e7d79..9c39f84c 100644 --- a/src/stereo_j2k_picture_asset.cc +++ b/src/stereo_j2k_picture_asset.cc @@ -143,11 +143,30 @@ StereoJ2KPictureAsset::equals(shared_ptr<const Asset> other, EqualityOptions con bool result = true; for (int i = 0; i < _intrinsic_duration; ++i) { - shared_ptr<const StereoJ2KPictureFrame> frame_A; - shared_ptr<const StereoJ2KPictureFrame> frame_B; try { - frame_A = reader->get_frame (i); - frame_B = other_reader->get_frame (i); + auto frame_A = reader->get_frame(i); + auto frame_B = other_reader->get_frame(i); + if (!frame_buffer_equals ( + i, opt, note, + frame_A.left().data(), frame_A.left().size(), + frame_B.left().data(), frame_B.left().size() + )) { + result = false; + if (!opt.keep_going) { + return result; + } + } + + if (!frame_buffer_equals ( + i, opt, note, + frame_A.right().data(), frame_A.right().size(), + frame_B.right().data(), frame_B.right().size() + )) { + result = false; + if (!opt.keep_going) { + return result; + } + } } catch (ReadError& e) { /* If there was a problem reading the frame data we'll just assume the two frames are not equal. @@ -156,27 +175,6 @@ StereoJ2KPictureAsset::equals(shared_ptr<const Asset> other, EqualityOptions con return false; } - if (!frame_buffer_equals ( - i, opt, note, - frame_A->left()->data(), frame_A->left()->size(), - frame_B->left()->data(), frame_B->left()->size() - )) { - result = false; - if (!opt.keep_going) { - return result; - } - } - - if (!frame_buffer_equals ( - i, opt, note, - frame_A->right()->data(), frame_A->right()->size(), - frame_B->right()->data(), frame_B->right()->size() - )) { - result = false; - if (!opt.keep_going) { - return result; - } - } } return result; |
