From b9dc0fbc6252e2c73dd2376b43d1a64b263aba43 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 8 Jun 2015 13:12:58 +0100 Subject: Better error checking. --- src/smpte_subtitle_asset.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/smpte_subtitle_asset.cc b/src/smpte_subtitle_asset.cc index eef28e51..87211cf2 100644 --- a/src/smpte_subtitle_asset.cc +++ b/src/smpte_subtitle_asset.cc @@ -177,16 +177,19 @@ SMPTESubtitleAsset::write (boost::filesystem::path p) const memcpy (descriptor.AssetID, writer_info.AssetUUID, ASDCP::UUIDlen); descriptor.ContainerDuration = latest_subtitle_out().as_editable_units (_edit_rate.numerator / _edit_rate.denominator); - /* XXX: fonts into descriptor? */ + /* XXX: should write fonts into the file somehow */ ASDCP::TimedText::MXFWriter writer; - Kumu::Result_t r = writer.OpenWrite (p.string().c_str(), writer_info, descriptor); + ASDCP::Result_t r = writer.OpenWrite (p.string().c_str(), writer_info, descriptor); if (ASDCP_FAILURE (r)) { boost::throw_exception (FileError ("could not open subtitle MXF for writing", p.string(), r)); } /* XXX: no encryption */ - writer.WriteTimedTextResource (xml_as_string ()); + r = writer.WriteTimedTextResource (xml_as_string ()); + if (ASDCP_FAILURE (r)) { + boost::throw_exception (MXFFileError ("could not write XML to timed text resource", p.string(), r)); + } writer.Finalize (); -- cgit v1.2.3