diff options
Diffstat (limited to 'src/lib/audio_buffers.cc')
| -rw-r--r-- | src/lib/audio_buffers.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/audio_buffers.cc b/src/lib/audio_buffers.cc index c3e89f130..403babaf7 100644 --- a/src/lib/audio_buffers.cc +++ b/src/lib/audio_buffers.cc @@ -206,6 +206,9 @@ AudioBuffers::accumulate_channel (AudioBuffers const * from, int from_channel, i } } +/** Ensure we have space for at least a certain number of frames. If we extend + * the buffers, fill the new space with silence. + */ void AudioBuffers::ensure_size (int frames) { @@ -218,6 +221,9 @@ AudioBuffers::ensure_size (int frames) if (!_data[i]) { throw bad_alloc (); } + for (int j = _allocated_frames; j < frames; ++j) { + _data[i][j] = 0; + } } _allocated_frames = frames; |
