Make similar changes to the previous commit for _xml_id.
[libdcp.git] / src / smpte_subtitle_asset.cc
index d0fbc0eb1ea140720c91e844a50d4d99df0fd203..11450ef3192cf0368fc045423bd30d28132ae252 100644 (file)
@@ -347,7 +347,8 @@ SMPTESubtitleAsset::xml_as_string () const
        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);
+       DCP_ASSERT (_xml_id);
+       root->add_child("Id", "dcst")->add_child_text ("urn:uuid:" + *_xml_id);
        root->add_child("ContentTitleText", "dcst")->add_child_text (_content_title_text);
        if (_annotation_text) {
                root->add_child("AnnotationText", "dcst")->add_child_text (_annotation_text.get ());
@@ -422,7 +423,8 @@ SMPTESubtitleAsset::write (boost::filesystem::path p) const
 
        descriptor.NamespaceName = subtitle_smpte_ns;
        unsigned int c;
-       Kumu::hex2bin (_xml_id.c_str(), descriptor.AssetID, ASDCP::UUIDlen, &c);
+       DCP_ASSERT (_xml_id);
+       Kumu::hex2bin (_xml_id->c_str(), descriptor.AssetID, ASDCP::UUIDlen, &c);
        DCP_ASSERT (c == Kumu::UUID_Length);
        descriptor.ContainerDuration = _intrinsic_duration;