diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-06-09 11:40:59 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-06-09 11:40:59 +0100 |
| commit | 2ac1dbfeaffa5166f104ef4a01fedc41f542cacf (patch) | |
| tree | 05608ab66d15e76009ef56a738ecbe7f1fabcee4 /src | |
| parent | 5c1b079a28941781c9cfa46d57e0c20b55681b32 (diff) | |
As I understand it all SMPTE subtitles are MXF-wrapped.
Diffstat (limited to 'src')
| -rw-r--r-- | src/smpte_subtitle_asset.cc | 38 | ||||
| -rw-r--r-- | src/smpte_subtitle_asset.h | 3 |
2 files changed, 17 insertions, 24 deletions
diff --git a/src/smpte_subtitle_asset.cc b/src/smpte_subtitle_asset.cc index 28d8b261..9878ea1f 100644 --- a/src/smpte_subtitle_asset.cc +++ b/src/smpte_subtitle_asset.cc @@ -49,36 +49,30 @@ SMPTESubtitleAsset::SMPTESubtitleAsset () } -/** Construct a SMPTESubtitleAsset by reading an XML or MXF file. +/** Construct a SMPTESubtitleAsset by reading an MXF file. * @param file Filename. - * @param mxf true if file is an MXF, false if it is XML. */ -SMPTESubtitleAsset::SMPTESubtitleAsset (boost::filesystem::path file, bool mxf) +SMPTESubtitleAsset::SMPTESubtitleAsset (boost::filesystem::path file) : SubtitleAsset (file) { shared_ptr<cxml::Document> xml (new cxml::Document ("SubtitleReel")); - if (mxf) { - ASDCP::TimedText::MXFReader reader; - Kumu::Result_t r = reader.OpenRead (file.string().c_str ()); - if (ASDCP_FAILURE (r)) { - boost::throw_exception (MXFFileError ("could not open MXF file for reading", file, r)); - } - - string s; - reader.ReadTimedTextResource (s, 0, 0); - stringstream t; - t << s; - xml->read_stream (t); - - ASDCP::WriterInfo info; - reader.FillWriterInfo (info); - _id = read_writer_info (info); - } else { - xml->read_file (file); - _id = xml->string_child("Id").substr (9); + ASDCP::TimedText::MXFReader reader; + Kumu::Result_t r = reader.OpenRead (file.string().c_str ()); + if (ASDCP_FAILURE (r)) { + boost::throw_exception (MXFFileError ("could not open MXF file for reading", file, r)); } + string s; + reader.ReadTimedTextResource (s, 0, 0); + stringstream t; + t << s; + xml->read_stream (t); + + ASDCP::WriterInfo info; + reader.FillWriterInfo (info); + _id = read_writer_info (info); + _load_font_nodes = type_children<dcp::SMPTELoadFontNode> (xml, "LoadFont"); _content_title_text = xml->string_child ("ContentTitleText"); diff --git a/src/smpte_subtitle_asset.h b/src/smpte_subtitle_asset.h index 37f58c6f..a01ef775 100644 --- a/src/smpte_subtitle_asset.h +++ b/src/smpte_subtitle_asset.h @@ -39,9 +39,8 @@ public: SMPTESubtitleAsset (); /** @param file File name - * @param mxf true if `file' is a MXF, or false if it is an XML file. */ - SMPTESubtitleAsset (boost::filesystem::path file, bool mxf = true); + SMPTESubtitleAsset (boost::filesystem::path file); bool equals ( boost::shared_ptr<const Asset>, |
