Add EqualityOptions option to ignore differences in LoadFont nodes.
authorCarl Hetherington <cth@carlh.net>
Thu, 10 Sep 2020 21:37:16 +0000 (23:37 +0200)
committerCarl Hetherington <cth@carlh.net>
Thu, 10 Sep 2020 23:03:42 +0000 (01:03 +0200)
src/interop_subtitle_asset.cc
src/types.h

index 6c9c6b42a3be235eb817a183a8f59452badbbe59..f64105208ae7b6c3dc1765d01e6412985ed3aeac 100644 (file)
@@ -137,22 +137,24 @@ InteropSubtitleAsset::equals (shared_ptr<const Asset> other_asset, EqualityOptio
                return false;
        }
 
-       list<shared_ptr<InteropLoadFontNode> >::const_iterator i = _load_font_nodes.begin ();
-       list<shared_ptr<InteropLoadFontNode> >::const_iterator j = other->_load_font_nodes.begin ();
+       if (!options.load_font_nodes_can_differ) {
+               list<shared_ptr<InteropLoadFontNode> >::const_iterator i = _load_font_nodes.begin ();
+               list<shared_ptr<InteropLoadFontNode> >::const_iterator j = other->_load_font_nodes.begin ();
+
+               while (i != _load_font_nodes.end ()) {
+                       if (j == other->_load_font_nodes.end ()) {
+                               note (DCP_ERROR, "<LoadFont> nodes differ");
+                               return false;
+                       }
 
-       while (i != _load_font_nodes.end ()) {
-               if (j == other->_load_font_nodes.end ()) {
-                       note (DCP_ERROR, "<LoadFont> nodes differ");
-                       return false;
-               }
+                       if (**i != **j) {
+                               note (DCP_ERROR, "<LoadFont> nodes differ");
+                               return false;
+                       }
 
-               if (**i != **j) {
-                       note (DCP_ERROR, "<LoadFont> nodes differ");
-                       return false;
+                       ++i;
+                       ++j;
                }
-
-               ++i;
-               ++j;
        }
 
        if (_movie_title != other->_movie_title) {
index 8297dbcc393d8026892719905b8886bcf2a471ae..c600b790ae2da4f30cac817c46d0a3a4219b3862 100644 (file)
@@ -206,6 +206,7 @@ struct EqualityOptions
                , reel_annotation_texts_can_differ (false)
                , reel_hashes_can_differ (false)
                , issue_dates_can_differ (false)
+               , load_font_nodes_can_differ (false)
                , keep_going (false)
        {}
 
@@ -223,6 +224,7 @@ struct EqualityOptions
        bool reel_hashes_can_differ;
        /** true if IssueDate nodes can differ */
        bool issue_dates_can_differ;
+       bool load_font_nodes_can_differ;
        bool keep_going;
 };