diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-11-20 00:40:35 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-11-20 00:40:35 +0100 |
| commit | f614b4526cd06a4d28b46bd2d98a55d56b97b14f (patch) | |
| tree | 1eaf03b5e145a0cb7d8a42a37c1b8e6240c6ac23 /src/reel_subtitle_asset.h | |
| parent | d989a83517fd77aa241c1423ac00cfed62d567fe (diff) | |
Tidy up handling of language metadata for subtitles.
Tried to normalise the idea that subtitle languages are stored as
strings but set as LanguageTags. This may be too defensive; perhaps
SMPTE language metadata is always right, or perhaps even if it isn't
we should throw errors.
Diffstat (limited to 'src/reel_subtitle_asset.h')
| -rw-r--r-- | src/reel_subtitle_asset.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/reel_subtitle_asset.h b/src/reel_subtitle_asset.h index 123478cf..a0cc405c 100644 --- a/src/reel_subtitle_asset.h +++ b/src/reel_subtitle_asset.h @@ -65,7 +65,7 @@ public: void set_language (dcp::LanguageTag language); - boost::optional<dcp::LanguageTag> language () const { + boost::optional<std::string> language () const { return _language; } @@ -73,7 +73,11 @@ private: std::string key_type () const; std::string cpl_node_name (Standard standard) const; - boost::optional<dcp::LanguageTag> _language; + /** As in other places, this is stored and returned as a string so that + * we can tolerate non-RFC-5646 strings, but must be set as a dcp::LanguageTag + * to try to ensure that we create compliant output. + */ + boost::optional<std::string> _language; }; } |
