diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-05-04 01:14:12 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-05-04 01:14:12 +0100 |
| commit | 41c4d628f7ef3c9f9b434d34ff099f5fe4de1ae4 (patch) | |
| tree | f912e10cfd99245933ffd3eaa0d39a01aec1daad /src/load_font.cc | |
| parent | 09e16aa3acf7878b54a4995a0be79890f26db09f (diff) | |
Port support for MXF-wrapped subtitles from 0.x
Diffstat (limited to 'src/load_font.cc')
| -rw-r--r-- | src/load_font.cc | 11 |
1 files changed, 9 insertions, 2 deletions
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 <libcxml/cxml.h> +using std::string; using boost::shared_ptr; +using boost::optional; using namespace dcp; LoadFont::LoadFont (boost::shared_ptr<const cxml::Node> node) { - id = node->string_attribute ("Id"); - uri = node->string_attribute ("URI"); + optional<string> 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"); } |
