From 915cecb8f2b4bb251e72bbcd6c41144b73f8bfd7 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 16 Feb 2020 22:23:28 +0100 Subject: Make a new AudioBuffers constructor and use it to avoid some use of the more complicated copy_from. --- src/lib/audio_buffers.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/lib/audio_buffers.cc') 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 other) copy_from (other.get(), other->_frames, 0, 0); } +AudioBuffers::AudioBuffers (boost::shared_ptr 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) { -- cgit v1.2.3