diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-01-08 10:05:49 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-01-08 10:05:49 +0000 |
| commit | 83591a4390db550a7d1495b9699c62315e2d7710 (patch) | |
| tree | 29c93f38853ae2d99c7bca8c7b52d2c294881c0e /src/stereo_picture_asset_writer.cc | |
| parent | 3a148fab61d2b23379589a4f0f256c21950742b8 (diff) | |
Throw better file errors (with numbers).
Diffstat (limited to 'src/stereo_picture_asset_writer.cc')
| -rw-r--r-- | src/stereo_picture_asset_writer.cc | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/stereo_picture_asset_writer.cc b/src/stereo_picture_asset_writer.cc index 19b6812d..81ce7fc0 100644 --- a/src/stereo_picture_asset_writer.cc +++ b/src/stereo_picture_asset_writer.cc @@ -70,16 +70,16 @@ StereoPictureAssetWriter::write (uint8_t* data, int size) uint64_t const before_offset = _state->mxf_writer.Tell (); string hash; - if (ASDCP_FAILURE ( - _state->mxf_writer.WriteFrame ( - _state->frame_buffer, - _next_eye == EYE_LEFT ? ASDCP::JP2K::SP_LEFT : ASDCP::JP2K::SP_RIGHT, - _state->encryption_context, - 0, - &hash) - )) { - - boost::throw_exception (MXFFileError ("error in writing video MXF", _asset->path().string())); + Kumu::Result_t r = _state->mxf_writer.WriteFrame ( + _state->frame_buffer, + _next_eye == EYE_LEFT ? ASDCP::JP2K::SP_LEFT : ASDCP::JP2K::SP_RIGHT, + _state->encryption_context, + 0, + &hash + ); + + if (ASDCP_FAILURE (r)) { + boost::throw_exception (MXFFileError ("error in writing video MXF", _asset->path().string(), r)); } _next_eye = _next_eye == EYE_LEFT ? EYE_RIGHT : EYE_LEFT; @@ -94,8 +94,9 @@ StereoPictureAssetWriter::fake_write (int size) assert (_started); assert (!_finalized); - if (ASDCP_FAILURE (_state->mxf_writer.FakeWriteFrame (size))) { - boost::throw_exception (MXFFileError ("error in writing video MXF", _asset->path().string())); + Kumu::Result_t r = _state->mxf_writer.FakeWriteFrame (size); + if (ASDCP_FAILURE (r)) { + boost::throw_exception (MXFFileError ("error in writing video MXF", _asset->path().string(), r)); } _next_eye = _next_eye == EYE_LEFT ? EYE_RIGHT : EYE_LEFT; @@ -107,8 +108,9 @@ StereoPictureAssetWriter::finalize () { assert (!_finalized); - if (ASDCP_FAILURE (_state->mxf_writer.Finalize())) { - boost::throw_exception (MXFFileError ("error in finalizing video MXF", _asset->path().string())); + Kumu::Result_t r = _state->mxf_writer.Finalize(); + if (ASDCP_FAILURE (r)) { + boost::throw_exception (MXFFileError ("error in finalizing video MXF", _asset->path().string(), r)); } _finalized = true; |
