mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 11:46:25 +01:00
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
This commit is contained in:
parent
981c8906fb
commit
46ea5f5f58
1 changed files with 5 additions and 4 deletions
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <boost/scoped_array.hpp>
|
||||||
|
|
||||||
#include "pbd/error.h"
|
#include "pbd/error.h"
|
||||||
#include "pbd/enumwriter.h"
|
#include "pbd/enumwriter.h"
|
||||||
|
|
@ -553,8 +554,8 @@ AudioTrack::roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
|
||||||
int
|
int
|
||||||
AudioTrack::export_stuff (BufferSet& buffers, sframes_t start, nframes_t nframes, bool enable_processing)
|
AudioTrack::export_stuff (BufferSet& buffers, sframes_t start, nframes_t nframes, bool enable_processing)
|
||||||
{
|
{
|
||||||
gain_t gain_buffer[nframes];
|
boost::scoped_array<gain_t> gain_buffer (new gain_t[nframes]);
|
||||||
float mix_buffer[nframes];
|
boost::scoped_array<float> mix_buffer (new float[nframes]);
|
||||||
ProcessorList::iterator i;
|
ProcessorList::iterator i;
|
||||||
boost::shared_ptr<AudioDiskstream> diskstream = audio_diskstream();
|
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);
|
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;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -576,7 +577,7 @@ AudioTrack::export_stuff (BufferSet& buffers, sframes_t start, nframes_t nframes
|
||||||
++bi;
|
++bi;
|
||||||
for ( ; bi != buffers.audio_end(); ++bi, ++n) {
|
for ( ; bi != buffers.audio_end(); ++bi, ++n) {
|
||||||
if (n < diskstream->n_channels().n_audio()) {
|
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;
|
return -1;
|
||||||
}
|
}
|
||||||
b = bi->data();
|
b = bi->data();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue