summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2017-02-14 17:02:57 +0000
committerCarl Hetherington <cth@carlh.net>2017-02-14 17:02:57 +0000
commitcab0005c7370a1101df604838ea214eb741098d7 (patch)
tree2b2e1b3f5bc279017a613c0b32942a81b293a6a4 /src
parent5dda5d997e389052b63f422776aa205434789751 (diff)
parentce32d6cd30b916acc30d19241168ad4e41be6bda (diff)
Merge branch '1.0' of git.carlh.net:git/libdcp into 1.0
Diffstat (limited to 'src')
-rw-r--r--src/dcp.cc2
-rw-r--r--src/j2k.cc7
2 files changed, 7 insertions, 2 deletions
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<SMPTESubtitleAsset> (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<FontAsset> (new FontAsset (i->first, path)));
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<const OpenJPEGImage> 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)) {