summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-04-13 01:18:05 +0000
committerCarl Hetherington <carl@carlh.net>2010-04-13 01:18:05 +0000
commit46ea5f5f5885dda6b10b75c104f726f6638c431e (patch)
tree401cf01c6496fb0bbad4904578cc20621868f54d /libs
parent981c8906fb9d2fc5b2071018a22947a87f6bd5db (diff)
Reduce stack requirement of AudioTrack::export_stuff, which fixes a crash when freezing.
git-svn-id: svn://localhost/ardour2/branches/3.0@6887 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/audio_track.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/libs/ardour/audio_track.cc b/libs/ardour/audio_track.cc
index f0c9a16744..7a26e300b9 100644
--- a/libs/ardour/audio_track.cc
+++ b/libs/ardour/audio_track.cc
@@ -17,6 +17,7 @@
*/
+#include <boost/scoped_array.hpp>
#include "pbd/error.h"
#include "pbd/enumwriter.h"
@@ -553,8 +554,8 @@ AudioTrack::roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
int
AudioTrack::export_stuff (BufferSet& buffers, sframes_t start, nframes_t nframes, bool enable_processing)
{
- gain_t gain_buffer[nframes];
- float mix_buffer[nframes];
+ boost::scoped_array<gain_t> gain_buffer (new gain_t[nframes]);
+ boost::scoped_array<float> mix_buffer (new float[nframes]);
ProcessorList::iterator i;
boost::shared_ptr<AudioDiskstream> diskstream = audio_diskstream();
@@ -565,7 +566,7 @@ AudioTrack::export_stuff (BufferSet& buffers, sframes_t start, nframes_t nframes
assert(buffers.get_audio(0).capacity() >= nframes);
- if (apl->read (buffers.get_audio(0).data(), mix_buffer, gain_buffer, start, nframes) != nframes) {
+ if (apl->read (buffers.get_audio(0).data(), mix_buffer.get(), gain_buffer.get(), start, nframes) != nframes) {
return -1;
}
@@ -576,7 +577,7 @@ AudioTrack::export_stuff (BufferSet& buffers, sframes_t start, nframes_t nframes
++bi;
for ( ; bi != buffers.audio_end(); ++bi, ++n) {
if (n < diskstream->n_channels().n_audio()) {
- if (apl->read (bi->data(), mix_buffer, gain_buffer, start, nframes, n) != nframes) {
+ if (apl->read (bi->data(), mix_buffer.get(), gain_buffer.get(), start, nframes, n) != nframes) {
return -1;
}
b = bi->data();