summaryrefslogtreecommitdiff
path: root/src/lib/audio_buffers.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-02-16 22:23:28 +0100
committerCarl Hetherington <cth@carlh.net>2020-02-16 22:23:28 +0100
commit915cecb8f2b4bb251e72bbcd6c41144b73f8bfd7 (patch)
treec0d601cae01940bf3d3d3dc9a64303ba6b4f8100 /src/lib/audio_buffers.cc
parent4787f3a114115a16f7007c7b1bd36fb2e2121345 (diff)
Make a new AudioBuffers constructor and use it to avoid some use of the more complicated copy_from.
Diffstat (limited to 'src/lib/audio_buffers.cc')
-rw-r--r--src/lib/audio_buffers.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/audio_buffers.cc b/src/lib/audio_buffers.cc
index 63204dd6a..cceb12672 100644
--- a/src/lib/audio_buffers.cc
+++ b/src/lib/audio_buffers.cc
@@ -52,6 +52,12 @@ AudioBuffers::AudioBuffers (boost::shared_ptr<const AudioBuffers> other)
copy_from (other.get(), other->_frames, 0, 0);
}
+AudioBuffers::AudioBuffers (boost::shared_ptr<const AudioBuffers> other, int32_t frames_to_copy, int32_t read_offset)
+{
+ allocate (other->_channels, frames_to_copy);
+ copy_from (other.get(), frames_to_copy, read_offset, 0);
+}
+
AudioBuffers &
AudioBuffers::operator= (AudioBuffers const & other)
{