diff options
| author | Carl Hetherington <cth@carlh.net> | 2019-05-21 21:23:55 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2019-05-21 21:23:55 +0100 |
| commit | b7c7e14463d91608b080a5a63fcfb4d330ced863 (patch) | |
| tree | f01a5873d92c6466504a2c97459e19d6dfc7fba7 | |
| parent | d7732381bc6898744d38ea9e9bb6a4be681b9a73 (diff) | |
Increase header size when writing SMPTE subtitle MXFs; fixes problems when writing lots of subs (DCP-o-matic bug #1561).
| -rw-r--r-- | src/smpte_subtitle_asset.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/smpte_subtitle_asset.cc b/src/smpte_subtitle_asset.cc index 3a712e03..7e715755 100644 --- a/src/smpte_subtitle_asset.cc +++ b/src/smpte_subtitle_asset.cc @@ -393,7 +393,10 @@ SMPTESubtitleAsset::write (boost::filesystem::path p) const descriptor.ContainerDuration = _intrinsic_duration; ASDCP::TimedText::MXFWriter writer; - ASDCP::Result_t r = writer.OpenWrite (p.string().c_str(), writer_info, descriptor); + /* This header size is a guess. Empirically it seems that each subtitle reference is 90 bytes, and we need some extra. + The defualt size is not enough for some feature-length PNG sub projects (see DCP-o-matic #1561). + */ + ASDCP::Result_t r = writer.OpenWrite (p.string().c_str(), writer_info, descriptor, _subtitles.size() * 90 + 16384); if (ASDCP_FAILURE (r)) { boost::throw_exception (FileError ("could not open subtitle MXF for writing", p.string(), r)); } |
