From 15f7f4ab0f89e7881d1249dab00b716045bcdf42 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 13 Feb 2017 19:45:03 +0000 Subject: More informative errors when opj_start_compress fails. --- cscript | 2 +- src/j2k.cc | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/cscript b/cscript index 2f5f6f76..9be355e6 100644 --- a/cscript +++ b/cscript @@ -37,7 +37,7 @@ def dependencies(target): if target.platform == 'windows' and target.version == 'xp': return (('libcxml', 'v0.15.4'), ('openjpeg-cdist', '5d8bffd'), ('asdcplib-cth', 'v0.1.3')) else: - return (('libcxml', 'v0.15.4'), ('openjpeg2-cdist', '94bdab1'), ('asdcplib-cth', 'v0.1.3')) + return (('libcxml', 'v0.15.4'), ('openjpeg2-cdist', '8ea62cc'), ('asdcplib-cth', 'v0.1.3')) def build(target, options): cmd = './waf configure --disable-examples --prefix=%s' % target.directory diff --git a/src/j2k.cc b/src/j2k.cc index 15f360c5..4a154574 100644 --- a/src/j2k.cc +++ b/src/j2k.cc @@ -301,7 +301,12 @@ dcp::compress_j2k (shared_ptr xyz, int bandwidth, int frame opj_stream_set_user_data (stream, buffer, write_free_function); if (!opj_start_compress (encoder, xyz->opj_image(), stream)) { - throw MiscError ("could not start JPEG2000 encoding"); + if ((errno & 0x61500) == 0x61500) { + /* We've had one of the magic error codes from our patched openjpeg */ + throw MiscError (String::compose ("could not start JPEG2000 encoding (%1)", errno & 0xff)); + } else { + throw MiscError ("could not start JPEG2000 encoding"); + } } if (!opj_encode (encoder, stream)) { -- cgit v1.2.3 From ce32d6cd30b916acc30d19241168ad4e41be6bda Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 13 Feb 2017 20:33:14 +0000 Subject: Another better error. --- src/dcp.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dcp.cc b/src/dcp.cc index 884e3cb5..b633c499 100644 --- a/src/dcp.cc +++ b/src/dcp.cc @@ -224,7 +224,7 @@ DCP::read (bool keep_going, ReadErrors* errors, bool ignore_incorrect_picture_mx other_assets.push_back (shared_ptr (new SMPTESubtitleAsset (path))); break; default: - throw DCPReadError ("Unknown MXF essence type"); + throw DCPReadError (String::compose ("Unknown MXF essence type %1 in %2", int(type), path.string())); } } else if (boost::filesystem::extension (path) == ".ttf") { other_assets.push_back (shared_ptr (new FontAsset (i->first, path))); -- cgit v1.2.3