#include "audio_buffers.h"
#include "dcpomatic_assert.h"
-#include <boost/make_shared.hpp>
#include <cassert>
#include <cstring>
#include <cmath>
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.
DCPOMATIC_ASSERT (read_offset >= 0);
DCPOMATIC_ASSERT (write_offset >= 0);
+ float** from_data = from->data ();
for (int i = 0; i < _channels; ++i) {
for (int j = 0; j < frames; ++j) {
- _data[i][j + write_offset] += from->data()[i][j + read_offset];
+ _data[i][j + write_offset] += from_data[i][j + read_offset];
}
}
}
shared_ptr<AudioBuffers>
AudioBuffers::channel (int c) const
{
- shared_ptr<AudioBuffers> o = make_shared<AudioBuffers> (1, frames ());
+ shared_ptr<AudioBuffers> o (new AudioBuffers (1, frames ()));
o->copy_channel_from (this, c, 0);
return o;
}
shared_ptr<AudioBuffers>
AudioBuffers::clone () const
{
- shared_ptr<AudioBuffers> b = make_shared<AudioBuffers> (channels (), frames ());
+ shared_ptr<AudioBuffers> b (new AudioBuffers (channels (), frames ()));
b->copy_from (this, frames (), 0, 0);
return b;
}