summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mono_picture_asset.cc9
-rw-r--r--src/stereo_picture_asset.cc14
-rw-r--r--src/types.h2
3 files changed, 20 insertions, 5 deletions
diff --git a/src/mono_picture_asset.cc b/src/mono_picture_asset.cc
index 91ab0d8a..f14e50c2 100644
--- a/src/mono_picture_asset.cc
+++ b/src/mono_picture_asset.cc
@@ -103,6 +103,8 @@ MonoPictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, No
shared_ptr<const MonoPictureAsset> other_picture = dynamic_pointer_cast<const MonoPictureAsset> (other);
DCP_ASSERT (other_picture);
+ bool result = true;
+
for (int i = 0; i < _intrinsic_duration; ++i) {
if (i >= other_picture->intrinsic_duration()) {
return false;
@@ -117,11 +119,14 @@ MonoPictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, No
frame_A->j2k_data(), frame_A->j2k_size(),
frame_B->j2k_data(), frame_B->j2k_size()
)) {
- return false;
+ result = false;
+ if (!opt.keep_going) {
+ return result;
+ }
}
}
- return true;
+ return result;
}
shared_ptr<PictureAssetWriter>
diff --git a/src/stereo_picture_asset.cc b/src/stereo_picture_asset.cc
index 76c353f1..e2494be6 100644
--- a/src/stereo_picture_asset.cc
+++ b/src/stereo_picture_asset.cc
@@ -105,6 +105,8 @@ StereoPictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt,
shared_ptr<const StereoPictureAsset> other_picture = dynamic_pointer_cast<const StereoPictureAsset> (other);
DCP_ASSERT (other_picture);
+ bool result = true;
+
for (int i = 0; i < _intrinsic_duration; ++i) {
shared_ptr<const StereoPictureFrame> frame_A;
shared_ptr<const StereoPictureFrame> frame_B;
@@ -124,7 +126,10 @@ StereoPictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt,
frame_A->left_j2k_data(), frame_A->left_j2k_size(),
frame_B->left_j2k_data(), frame_B->left_j2k_size()
)) {
- return false;
+ result = false;
+ if (!opt.keep_going) {
+ return result;
+ }
}
if (!frame_buffer_equals (
@@ -132,9 +137,12 @@ StereoPictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt,
frame_A->right_j2k_data(), frame_A->right_j2k_size(),
frame_B->right_j2k_data(), frame_B->right_j2k_size()
)) {
- return false;
+ result = false;
+ if (!opt.keep_going) {
+ return result;
+ }
}
}
- return true;
+ return result;
}
diff --git a/src/types.h b/src/types.h
index 1cd116c9..16000daa 100644
--- a/src/types.h
+++ b/src/types.h
@@ -166,6 +166,7 @@ struct EqualityOptions
, reel_annotation_texts_can_differ (false)
, reel_hashes_can_differ (false)
, issue_dates_can_differ (false)
+ , keep_going (false)
{}
/** The maximum allowable mean difference in pixel value between two images */
@@ -182,6 +183,7 @@ struct EqualityOptions
bool reel_hashes_can_differ;
/** true if IssueDate nodes can differ */
bool issue_dates_can_differ;
+ bool keep_going;
};
/* I've been unable to make mingw happy with ERROR as a symbol, so