Fix build on old GCC.
[libdcp.git] / src / smpte_subtitle_asset.cc
index a55b91ae8477e7242d9248666d59bac10500fc20..0fa315b905a69484c2966bf77c2da8111bbe2f4a 100644 (file)
  */
 
 
-#include "smpte_subtitle_asset.h"
-#include "smpte_load_font_node.h"
-#include "exceptions.h"
-#include "xml.h"
-#include "raw_convert.h"
-#include "dcp_assert.h"
-#include "util.h"
 #include "compose.hpp"
 #include "crypto_context.h"
+#include "dcp_assert.h"
+#include "exceptions.h"
+#include "raw_convert.h"
+#include "smpte_load_font_node.h"
+#include "smpte_subtitle_asset.h"
 #include "subtitle_image.h"
+#include "util.h"
+#include "warnings.h"
+#include "xml.h"
+LIBDCP_DISABLE_WARNINGS
 #include <asdcp/AS_DCP.h>
 #include <asdcp/KM_util.h>
 #include <asdcp/KM_log.h>
 #include <libxml++/libxml++.h>
+LIBDCP_ENABLE_WARNINGS
 #include <boost/algorithm/string.hpp>
 
 
@@ -112,7 +115,6 @@ SMPTESubtitleAsset::SMPTESubtitleAsset (boost::filesystem::path file)
                        xml = make_shared<cxml::Document>("SubtitleReel");
                        xml->read_file (file);
                        parse_xml (xml);
-                       _id = _xml_id = remove_urn_uuid (xml->string_child ("Id"));
                } catch (cxml::Error& e) {
                        boost::throw_exception (
                                ReadError (
@@ -253,6 +255,13 @@ SMPTESubtitleAsset::read_mxf_descriptor (shared_ptr<ASDCP::TimedText::MXFReader>
        }
 
        _intrinsic_duration = descriptor.ContainerDuration;
+       /* The thing which is called AssetID in the descriptor is also known as the
+        * ResourceID of the MXF.  We store that, at present just for verification
+        * purposes.
+        */
+       char id[64];
+       Kumu::bin2UUIDhex (descriptor.AssetID, ASDCP::UUIDlen, id, sizeof(id));
+       _resource_id = id;
 }