summaryrefslogtreecommitdiff
path: root/src/lib/audio_buffers.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-07-11 15:50:18 +0100
committerCarl Hetherington <cth@carlh.net>2013-07-11 15:50:18 +0100
commit4122f932b1dc25f7a4592f49f2c9ab19d63b3a4e (patch)
treeda592cad1e8e7293d22dcc45839de2a0f11a1d68 /src/lib/audio_buffers.cc
parentbba1bd9b08eb78bda8cdf7fa1393f3eeb2a504d9 (diff)
Add test for audio delay, and do it in the player rather than the decoder.
Diffstat (limited to 'src/lib/audio_buffers.cc')
-rw-r--r--src/lib/audio_buffers.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/audio_buffers.cc b/src/lib/audio_buffers.cc
index 403babaf7..6d4eb8514 100644
--- a/src/lib/audio_buffers.cc
+++ b/src/lib/audio_buffers.cc
@@ -144,6 +144,18 @@ AudioBuffers::make_silent (int c)
}
}
+void
+AudioBuffers::make_silent (int from, int frames)
+{
+ assert ((from + frames) <= _allocated_frames);
+
+ for (int c = 0; c < _channels; ++c) {
+ for (int i = from; i < (from + frames); ++i) {
+ _data[c][i] = 0;
+ }
+ }
+}
+
/** Copy data from another AudioBuffers to this one. All channels are copied.
* @param from AudioBuffers to copy from; must have the same number of channels as this.
* @param frames_to_copy Number of frames to copy.