summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-09-10 23:37:16 +0200
committerCarl Hetherington <cth@carlh.net>2020-09-11 01:03:42 +0200
commit759ebfc9322cda595a793be004e086389229e65d (patch)
tree5720bd92535279a86faa1db05b8666c461a466e2
parent17612efe9039ba2074299b5423cb7b927efd24a2 (diff)
Add EqualityOptions option to ignore differences in LoadFont nodes.
-rw-r--r--src/interop_subtitle_asset.cc28
-rw-r--r--src/types.h2
2 files changed, 17 insertions, 13 deletions
diff --git a/src/interop_subtitle_asset.cc b/src/interop_subtitle_asset.cc
index 6c9c6b42..f6410520 100644
--- a/src/interop_subtitle_asset.cc
+++ b/src/interop_subtitle_asset.cc
@@ -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) {
diff --git a/src/types.h b/src/types.h
index 8297dbcc..c600b790 100644
--- a/src/types.h
+++ b/src/types.h
@@ -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;
};