From f68a99a93b7a735d9983d8946f058a71f5b11cd4 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 16 May 2023 23:12:40 +0200 Subject: Make it possible to write subtitle assets without any tags. --- src/interop_subtitle_asset.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/interop_subtitle_asset.cc') diff --git a/src/interop_subtitle_asset.cc b/src/interop_subtitle_asset.cc index 8fb115a7..57468908 100644 --- a/src/interop_subtitle_asset.cc +++ b/src/interop_subtitle_asset.cc @@ -107,7 +107,7 @@ InteropSubtitleAsset::InteropSubtitleAsset () string -InteropSubtitleAsset::xml_as_string () const +InteropSubtitleAsset::xml_as_string(FontTags font_tags) const { xmlpp::Document doc; auto root = doc.create_root_node ("DCSubtitle"); @@ -124,7 +124,7 @@ InteropSubtitleAsset::xml_as_string () const load_font->set_attribute ("URI", i->uri); } - subtitles_as_xml (root, 250, Standard::INTEROP); + subtitles_as_xml(root, 250, Standard::INTEROP, font_tags); return format_xml(doc, {}); } @@ -190,14 +190,14 @@ InteropSubtitleAsset::load_font_nodes () const void -InteropSubtitleAsset::write (boost::filesystem::path p) const +InteropSubtitleAsset::write(boost::filesystem::path p, FontTags font_tags) const { File f(p, "wb"); if (!f) { throw FileError ("Could not open file for writing", p, -1); } - _raw_xml = xml_as_string (); + _raw_xml = xml_as_string(font_tags); /* length() here gives bytes not characters */ f.write(_raw_xml->c_str(), 1, _raw_xml->length()); -- cgit v1.2.3