summaryrefslogtreecommitdiff
path: root/src/lib/audio_buffers.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-01-25 10:05:34 +0100
committerCarl Hetherington <cth@carlh.net>2020-01-25 10:05:34 +0100
commitf62398d081db17afd1816bfc8312afb386f22e78 (patch)
tree99f58fc2f97868cae75638217bb027a303456f83 /src/lib/audio_buffers.cc
parentaf0edaf7dcd36c367cb585c98e8413c5347a7386 (diff)
Fix thinko two commits ago.
Diffstat (limited to 'src/lib/audio_buffers.cc')
-rw-r--r--src/lib/audio_buffers.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/audio_buffers.cc b/src/lib/audio_buffers.cc
index 8d3a897c4..82df9d6f6 100644
--- a/src/lib/audio_buffers.cc
+++ b/src/lib/audio_buffers.cc
@@ -269,8 +269,11 @@ AudioBuffers::ensure_size (int32_t frames)
}
}
- make_silent (_allocated_frames, frames - _allocated_frames);
+ int32_t const old_allocated = _allocated_frames;
_allocated_frames = frames;
+ if (old_allocated < _allocated_frames) {
+ make_silent (old_allocated, _allocated_frames - old_allocated);
+ }
}
/** Mix some other buffers with these ones. The AudioBuffers must have the same number of channels.