diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-02-29 01:00:02 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-02-29 01:00:02 +0000 |
| commit | 45841f333f295200ec461607f85d64e7b1e99249 (patch) | |
| tree | 21a3b246d9b677cbf57ca0ee3e7c33e8318fab59 | |
| parent | 8f7a014e6d11c107b520ac3c869b1cc7bef1bbd0 (diff) | |
Add workaround for (apparently) incorrectly-labelled stereo MXFs.
| -rw-r--r-- | src/dcp.cc | 13 | ||||
| -rw-r--r-- | src/dcp.h | 5 |
2 files changed, 15 insertions, 3 deletions
@@ -87,7 +87,7 @@ survivable_error (bool keep_going, dcp::DCP::ReadErrors* errors, T const & e) } void -DCP::read (bool keep_going, ReadErrors* errors) +DCP::read (bool keep_going, ReadErrors* errors, bool ignore_incorrect_picture_mxf_type) { /* Read the ASSETMAP */ @@ -160,7 +160,16 @@ DCP::read (bool keep_going, ReadErrors* errors) case ASDCP::ESS_MPEG2_VES: throw DCPReadError ("MPEG2 video essences are not supported"); case ASDCP::ESS_JPEG_2000: - other_assets.push_back (shared_ptr<MonoPictureAsset> (new MonoPictureAsset (path))); + try { + other_assets.push_back (shared_ptr<MonoPictureAsset> (new MonoPictureAsset (path))); + } catch (dcp::MXFFileError& e) { + if (ignore_incorrect_picture_mxf_type && e.number() == ASDCP::RESULT_SFORMAT) { + /* Tried to load it as mono but the error says it's stereo; try that instead */ + other_assets.push_back (shared_ptr<StereoPictureAsset> (new StereoPictureAsset (path))); + } else { + throw; + } + } break; case ASDCP::ESS_PCM_24b_48k: case ASDCP::ESS_PCM_24b_96k: @@ -71,8 +71,11 @@ public: /** Read the DCP's structure into this object. * @param keep_going true to try to keep going in the face of (some) errors. * @param errors List of errors that will be added to if keep_going is true. + * @param ignore_incorrect_picture_mxf_type true to try loading MXF files marked as monoscopic + * as stereoscopic if the monoscopic load fails; fixes problems some 3D DCPs that (I think) + * have an incorrect descriptor in their MXF. */ - void read (bool keep_going = false, ReadErrors* errors = 0); + void read (bool keep_going = false, ReadErrors* errors = 0, bool ignore_incorrect_picture_mxf_type = false); /** Compare this DCP with another, according to various options. * @param other DCP to compare this one to. |
