Better error checking.
authorCarl Hetherington <cth@carlh.net>
Mon, 8 Jun 2015 12:12:58 +0000 (13:12 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 8 Jun 2015 12:12:58 +0000 (13:12 +0100)
src/smpte_subtitle_asset.cc

index eef28e510ca5e4c8a2091e41ffa4928aafcc113a..87211cf2b7a9219c0862a1c3146faf332ed130f4 100644 (file)
@@ -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 ();