summaryrefslogtreecommitdiff
path: root/libs/ardour/session.cc
diff options
context:
space:
mode:
authorJesse Chappell <jesse@essej.net>2006-02-13 18:57:33 +0000
committerJesse Chappell <jesse@essej.net>2006-02-13 18:57:33 +0000
commit51462b3eba73a29d801bd6b79a6f2c9e262d1b42 (patch)
treeab1f08568b2cd5d998d26872e33e4c41964345c5 /libs/ardour/session.cc
parente92c949f3ceb80b9892e70c7d30540a2b45fbf7d (diff)
fixed various nasty send issues
git-svn-id: svn://localhost/trunk/ardour2@324 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session.cc')
-rw-r--r--libs/ardour/session.cc29
1 files changed, 29 insertions, 0 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index 0b5cd8f3c1..4361bd244e 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -390,6 +390,10 @@ Session::~Session ()
free(*i);
}
+ for (vector<Sample*>::iterator i = _send_buffers.begin(); i != _send_buffers.end(); ++i) {
+ free(*i);
+ }
+
for (map<RunContext,char*>::iterator i = _conversion_buffers.begin(); i != _conversion_buffers.end(); ++i) {
delete [] (i->second);
}
@@ -1451,6 +1455,21 @@ Session::set_block_size (jack_nframes_t nframes)
ensure_passthru_buffers (np);
+ for (vector<Sample*>::iterator i = _send_buffers.begin(); i != _send_buffers.end(); ++i) {
+ free(*i);
+
+ Sample *buf;
+#ifdef NO_POSIX_MEMALIGN
+ buf = (Sample *) malloc(current_block_size * sizeof(Sample));
+#else
+ posix_memalign((void **)&buf,16,current_block_size * 4);
+#endif
+ *i = buf;
+
+ memset (*i, 0, sizeof (Sample) * current_block_size);
+ }
+
+
if (_gain_automation_buffer) {
delete [] _gain_automation_buffer;
}
@@ -3232,6 +3251,16 @@ Session::ensure_passthru_buffers (uint32_t howmany)
memset (p, 0, sizeof (Sample) * current_block_size);
_silent_buffers.push_back (p);
+ *p = 0;
+
+#ifdef NO_POSIX_MEMALIGN
+ p = (Sample *) malloc(current_block_size * sizeof(Sample));
+#else
+ posix_memalign((void **)&p,16,current_block_size * 4);
+#endif
+ memset (p, 0, sizeof (Sample) * current_block_size);
+ _send_buffers.push_back (p);
+
}
allocate_pan_automation_buffers (current_block_size, howmany, false);
}