diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-02-16 22:23:28 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-02-16 22:23:28 +0100 |
| commit | 915cecb8f2b4bb251e72bbcd6c41144b73f8bfd7 (patch) | |
| tree | c0d601cae01940bf3d3d3dc9a64303ba6b4f8100 /src/lib/writer.cc | |
| parent | 4787f3a114115a16f7007c7b1bd36fb2e2121345 (diff) | |
Make a new AudioBuffers constructor and use it to avoid some use of the more complicated copy_from.
Diffstat (limited to 'src/lib/writer.cc')
| -rw-r--r-- | src/lib/writer.cc | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/lib/writer.cc b/src/lib/writer.cc index d85db5689..c1b66cd4c 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -284,15 +284,12 @@ Writer::write (shared_ptr<const AudioBuffers> audio, DCPTime const time) }; if (part_frames[0]) { - shared_ptr<AudioBuffers> part (new AudioBuffers (audio->channels(), part_frames[0])); - part->copy_from (audio.get(), part_frames[0], 0, 0); + shared_ptr<AudioBuffers> part (new AudioBuffers(audio, part_frames[0], 0)); _audio_reel->write (part); } if (part_frames[1]) { - shared_ptr<AudioBuffers> part (new AudioBuffers (audio->channels(), part_frames[1])); - part->copy_from (audio.get(), part_frames[1], part_frames[0], 0); - audio = part; + audio.reset (new AudioBuffers(audio, part_frames[1], part_frames[0])); } else { audio.reset (); } |
