Merge.
[libdcp.git] / src / stereo_picture_asset.cc
index 76c353f1732e0a4b272c62c61d05802943ade113..e2494be6f417649bd7581e17603aa9d922e7bcd0 100644 (file)
@@ -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;
 }