diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-08-27 22:59:12 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-09-21 21:57:18 +0200 |
| commit | b933775fc54e0b51ad3777d72bf2866f0c04bacc (patch) | |
| tree | c13133d7cfe9722f3b2eeaa52a8686e029172377 /src/reel_subtitle_asset.cc | |
| parent | 1ae2755dbbaa30b6240dfd304c289253a577b424 (diff) | |
Support CPL metadata.
Diffstat (limited to 'src/reel_subtitle_asset.cc')
| -rw-r--r-- | src/reel_subtitle_asset.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/reel_subtitle_asset.cc b/src/reel_subtitle_asset.cc index 4fa9fd0a..f7df36f8 100644 --- a/src/reel_subtitle_asset.cc +++ b/src/reel_subtitle_asset.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2017 Carl Hetherington <cth@carlh.net> + Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net> This file is part of libdcp. @@ -35,6 +35,7 @@ * @brief ReelSubtitleAsset class. */ +#include "language_tag.h" #include "subtitle_asset.h" #include "reel_subtitle_asset.h" #include "smpte_subtitle_asset.h" @@ -57,7 +58,10 @@ ReelSubtitleAsset::ReelSubtitleAsset (boost::shared_ptr<const cxml::Node> node) : ReelAsset (node) , ReelMXF (node) { - node->ignore_child ("Language"); + optional<string> const language = node->optional_string_child("Language"); + if (language) { + _language = dcp::LanguageTag(*language); + } node->done (); } @@ -78,6 +82,9 @@ ReelSubtitleAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const { xmlpp::Node* asset = write_to_cpl_asset (node, standard, hash()); write_to_cpl_mxf (asset); + if (_language) { + asset->add_child("Language")->add_child_text(_language->to_string()); + } return asset; } |
