diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-12-06 20:27:00 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-12-06 20:27:00 +0000 |
| commit | 7e0ebcd1f19c8365d16a5fb5a42907867d15cb20 (patch) | |
| tree | a3226ddbf3049485250b51b4b856e8bc14e3232a /src | |
| parent | 5700bcadb7378ac018b2879a8d128ba6b098b6b8 (diff) | |
Remove exception thrown on a short audio frame. I don't think
the caller can reasonably be expected to know what constitutes
a DCP audio "frame", so it's not really for them to round their
inputs. libdcp will fill any shortfall with silence, anyway.
Diffstat (limited to 'src')
| -rw-r--r-- | src/sound_asset.cc | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/sound_asset.cc b/src/sound_asset.cc index 500a72e5..e987239a 100644 --- a/src/sound_asset.cc +++ b/src/sound_asset.cc @@ -155,25 +155,18 @@ SoundAsset::construct (boost::function<string (Channel)> get_path) for (int i = 0; i < _length; ++i) { - byte_t *data_s = frame_buffer.Data(); - byte_t *data_e = data_s + frame_buffer.Capacity(); - byte_t sample_size = ASDCP::PCM::CalcSampleSize (audio_desc_channel[0]); - int offset = 0; - for (int j = 0; j < _channels; ++j) { memset (frame_buffer_channel[j].Data(), 0, frame_buffer_channel[j].Capacity()); if (ASDCP_FAILURE (pcm_parser_channel[j].ReadFrame (frame_buffer_channel[j]))) { throw MiscError ("could not read audio frame"); } - - if (frame_buffer_channel[j].Size() != frame_buffer_channel[j].Capacity()) { - stringstream s; - s << "short audio frame; " << _channels << " channels, " - << frame_buffer_channel[j].Size() << " vs " << frame_buffer_channel[j].Capacity(); - throw MiscError (s.str ()); - } } + byte_t *data_s = frame_buffer.Data(); + byte_t *data_e = data_s + frame_buffer.Capacity(); + byte_t sample_size = ASDCP::PCM::CalcSampleSize (audio_desc_channel[0]); + int offset = 0; + while (data_s < data_e) { for (int j = 0; j < _channels; ++j) { byte_t* frame = frame_buffer_channel[j].Data() + offset; |
