diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-12-29 01:01:19 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-12-29 01:01:19 +0000 |
| commit | 7d0aab7961d72ab194b1c9f2c6f348a91ed75c35 (patch) | |
| tree | 2ea37f2939a7f1ec3a179765c6e6400e199ec0cb /src | |
| parent | 182f32783cb475a76001393f18ddbf79bf60f921 (diff) | |
Add an assertion and a better error message.
Diffstat (limited to 'src')
| -rw-r--r-- | src/sound_asset_writer.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/sound_asset_writer.cc b/src/sound_asset_writer.cc index e628b26e..3cb25db5 100644 --- a/src/sound_asset_writer.cc +++ b/src/sound_asset_writer.cc @@ -93,6 +93,7 @@ void SoundAssetWriter::write (float const * const * data, int frames) { DCP_ASSERT (!_finalized); + DCP_ASSERT (frames > 0); static float const clip = 1.0f - (1.0f / pow (2, 23)); @@ -157,8 +158,11 @@ SoundAssetWriter::finalize () write_current_frame (); } - if (_started && ASDCP_FAILURE (_state->mxf_writer.Finalize())) { - boost::throw_exception (MiscError ("could not finalise audio MXF")); + if (_started) { + ASDCP::Result_t const r = _state->mxf_writer.Finalize(); + if (ASDCP_FAILURE(r)) { + boost::throw_exception (MiscError (String::compose ("could not finalise audio MXF (%1)", int(r)))); + } } _asset->_intrinsic_duration = _frames_written; |
