#include "colour_conversion.h"
#include "AS_DCP.h"
#include "KM_fileio.h"
+#include "compose.hpp"
#include <openjpeg.h>
#define DCI_GAMMA 2.6
_buffer = new ASDCP::JP2K::SFrameBuffer (4 * Kumu::Megabyte);
if (ASDCP_FAILURE (reader.ReadFrame (n, *_buffer))) {
- boost::throw_exception (DCPReadError ("could not read video frame"));
+ boost::throw_exception (DCPReadError (String::compose ("could not read video frame %1 of %2", n, mxf_path.string())));
}
}
DCP_ASSERT (other_picture);
for (int i = 0; i < _intrinsic_duration; ++i) {
- shared_ptr<const StereoPictureFrame> frame_A = get_frame (i);
- shared_ptr<const StereoPictureFrame> frame_B = other_picture->get_frame (i);
+ shared_ptr<const StereoPictureFrame> frame_A;
+ shared_ptr<const StereoPictureFrame> frame_B;
+ try {
+ frame_A = get_frame (i);
+ frame_B = other_picture->get_frame (i);
+ } catch (DCPReadError& e) {
+ /* If there was a problem reading the frame data we'll just assume
+ the two frames are not equal.
+ */
+ note (DCP_ERROR, e.what ());
+ return false;
+ }
if (!frame_buffer_equals (
i, opt, note,