From 41c4d628f7ef3c9f9b434d34ff099f5fe4de1ae4 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 4 May 2014 01:14:12 +0100 Subject: Port support for MXF-wrapped subtitles from 0.x --- src/load_font.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/load_font.cc') diff --git a/src/load_font.cc b/src/load_font.cc index 707f4a0b..b46569c8 100644 --- a/src/load_font.cc +++ b/src/load_font.cc @@ -20,11 +20,18 @@ #include "load_font.h" #include +using std::string; using boost::shared_ptr; +using boost::optional; using namespace dcp; LoadFont::LoadFont (boost::shared_ptr node) { - id = node->string_attribute ("Id"); - uri = node->string_attribute ("URI"); + optional x = node->optional_string_attribute ("Id"); + if (!x) { + x = node->optional_string_attribute ("ID"); + } + id = x.get_value_or (""); + + uri = node->optional_string_attribute ("URI"); } -- cgit v1.2.3