diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-06-21 01:14:06 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-06-21 01:14:06 +0100 |
| commit | 5a5324ed3a381a86dfe0a6e3932c1d58fdcd596f (patch) | |
| tree | 769dca1358e35017ce5a5b3ab2dfafe2b24d61ed /src/lib/audio_buffers.cc | |
| parent | 4e83acad0c2a5c528709a175a80261b8147d3b49 (diff) | |
Use make_shared<>.
Diffstat (limited to 'src/lib/audio_buffers.cc')
| -rw-r--r-- | src/lib/audio_buffers.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/audio_buffers.cc b/src/lib/audio_buffers.cc index 2ab8e187e..4c3c2d4a7 100644 --- a/src/lib/audio_buffers.cc +++ b/src/lib/audio_buffers.cc @@ -20,6 +20,7 @@ #include "audio_buffers.h" #include "dcpomatic_assert.h" +#include <boost/make_shared.hpp> #include <cassert> #include <cstring> #include <cmath> @@ -27,6 +28,7 @@ using std::bad_alloc; using boost::shared_ptr; +using boost::make_shared; /** Construct an AudioBuffers. Audio data is undefined after this constructor. * @param channels Number of channels. @@ -305,7 +307,7 @@ AudioBuffers::apply_gain (float dB) shared_ptr<AudioBuffers> AudioBuffers::channel (int c) const { - shared_ptr<AudioBuffers> o (new AudioBuffers (1, frames ())); + shared_ptr<AudioBuffers> o = make_shared<AudioBuffers> (1, frames ()); o->copy_channel_from (this, c, 0); return o; } @@ -320,7 +322,7 @@ AudioBuffers::copy_channel_from (AudioBuffers const * from, int from_channel, in shared_ptr<AudioBuffers> AudioBuffers::clone () const { - shared_ptr<AudioBuffers> b (new AudioBuffers (channels (), frames ())); + shared_ptr<AudioBuffers> b = make_shared<AudioBuffers> (channels (), frames ()); b->copy_from (this, frames (), 0, 0); return b; } |
