summaryrefslogtreecommitdiff
path: root/src/dcp.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/dcp.cc')
-rw-r--r--src/dcp.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/dcp.cc b/src/dcp.cc
index 2aa1d575..7ec7577f 100644
--- a/src/dcp.cc
+++ b/src/dcp.cc
@@ -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: