From 759ebfc9322cda595a793be004e086389229e65d Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 10 Sep 2020 23:37:16 +0200 Subject: Add EqualityOptions option to ignore differences in LoadFont nodes. --- src/interop_subtitle_asset.cc | 28 +++++++++++++++------------- src/types.h | 2 ++ 2 files changed, 17 insertions(+), 13 deletions(-) (limited to 'src') 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 other_asset, EqualityOptio return false; } - list >::const_iterator i = _load_font_nodes.begin (); - list >::const_iterator j = other->_load_font_nodes.begin (); + if (!options.load_font_nodes_can_differ) { + list >::const_iterator i = _load_font_nodes.begin (); + list >::const_iterator j = other->_load_font_nodes.begin (); + + while (i != _load_font_nodes.end ()) { + if (j == other->_load_font_nodes.end ()) { + note (DCP_ERROR, " nodes differ"); + return false; + } - while (i != _load_font_nodes.end ()) { - if (j == other->_load_font_nodes.end ()) { - note (DCP_ERROR, " nodes differ"); - return false; - } + if (**i != **j) { + note (DCP_ERROR, " nodes differ"); + return false; + } - if (**i != **j) { - note (DCP_ERROR, " 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; }; -- cgit v1.2.3