From 0d7a7b85095a5accf5f3666bc1d0a037a5455d0b Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 9 Dec 2020 10:21:57 +0100 Subject: Bv2.1 6.2.1: Check that subtitle XML conforms to RFC 5646. --- src/verify.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/verify.cc') diff --git a/src/verify.cc b/src/verify.cc index b4408946..89d84eef 100644 --- a/src/verify.cc +++ b/src/verify.cc @@ -46,6 +46,7 @@ #include "exceptions.h" #include "compose.hpp" #include "raw_convert.h" +#include "smpte_subtitle_asset.h" #include #include #include @@ -572,12 +573,19 @@ verify_main_subtitle_asset ( list& notes ) { - shared_ptr reel_asset = reel->main_subtitle (); - stage ("Checking subtitle XML", reel->main_subtitle()->asset()->file()); + shared_ptr asset = reel->main_subtitle()->asset(); + stage ("Checking subtitle XML", asset->file()); /* Note: we must not use SubtitleAsset::xml_as_string() here as that will mean the data on disk * gets passed through libdcp which may clean up and therefore hide errors. */ - validate_xml (reel->main_subtitle()->asset()->raw_xml(), xsd_dtd_directory, notes); + validate_xml (asset->raw_xml(), xsd_dtd_directory, notes); + + shared_ptr smpte = dynamic_pointer_cast(asset); + if (smpte) { + if (smpte->language()) { + verify_language_tag (*smpte->language(), notes); + } + } } -- cgit v1.2.3