From c763ce17ea1d2bf621a343c4893f5d0c390ec433 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 8 Jan 2019 09:58:56 +0000 Subject: [PATCH] Fix incorrect XML namespace in MXF header; I was using the prefix instead of the namespace URI for what asdcplib calls TimedTextDescriptor::NamespaceName. Thanks to clairmeta; see https://github.com/Ymagis/ClairMeta/issues/72 --- src/smpte_subtitle_asset.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/smpte_subtitle_asset.cc b/src/smpte_subtitle_asset.cc index 94b16d5b..f9406793 100644 --- a/src/smpte_subtitle_asset.cc +++ b/src/smpte_subtitle_asset.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2018 Carl Hetherington + Copyright (C) 2012-2019 Carl Hetherington This file is part of libdcp. @@ -64,6 +64,8 @@ using boost::dynamic_pointer_cast; using boost::optional; using namespace dcp; +static string const subtitle_smpte_ns = "http://www.smpte-ra.org/schemas/428-7/2010/DCST"; + SMPTESubtitleAsset::SMPTESubtitleAsset () : MXF (SMPTE) , _intrinsic_duration (0) @@ -280,7 +282,7 @@ SMPTESubtitleAsset::xml_as_string () const { xmlpp::Document doc; xmlpp::Element* root = doc.create_root_node ("dcst:SubtitleReel"); - root->set_namespace_declaration ("http://www.smpte-ra.org/schemas/428-7/2010/DCST", "dcst"); + root->set_namespace_declaration (subtitle_smpte_ns, "dcst"); root->set_namespace_declaration ("http://www.w3.org/2001/XMLSchema", "xs"); root->add_child("Id", "dcst")->add_child_text ("urn:uuid:" + _xml_id); @@ -356,7 +358,7 @@ SMPTESubtitleAsset::write (boost::filesystem::path p) const } } - descriptor.NamespaceName = "dcst"; + descriptor.NamespaceName = subtitle_smpte_ns; unsigned int c; Kumu::hex2bin (_xml_id.c_str(), descriptor.AssetID, ASDCP::UUIDlen, &c); DCP_ASSERT (c == Kumu::UUID_Length); -- 2.30.2