summaryrefslogtreecommitdiff
path: root/libs/ardour/send.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/send.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/send.cc')
-rw-r--r--libs/ardour/send.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/libs/ardour/send.cc b/libs/ardour/send.cc
index f0afea5be5..50fdd4a96a 100644
--- a/libs/ardour/send.cc
+++ b/libs/ardour/send.cc
@@ -107,7 +107,17 @@ Send::run (vector<Sample *>& bufs, uint32_t nbufs, jack_nframes_t nframes, jack_
{
if (active()) {
- IO::deliver_output (bufs, nbufs, nframes, offset);
+ // we have to copy the input, because IO::deliver_output may alter the buffers
+ // in-place, which a send must never do.
+
+ vector<Sample*>& sendbufs = _session.get_send_buffers();
+
+ for (size_t i=0; i < nbufs; ++i) {
+ memcpy (sendbufs[i], bufs[i], sizeof (Sample) * nframes);
+ }
+
+
+ IO::deliver_output (sendbufs, nbufs, nframes, offset);
if (_metering) {
uint32_t n;
@@ -122,7 +132,7 @@ Send::run (vector<Sample *>& bufs, uint32_t nbufs, jack_nframes_t nframes, jack_
} else {
for (n = 0; n < no; ++n) {
- _peak_power[n] = Session::compute_peak (output(n)->get_buffer(nframes+offset) + offset, nframes, _peak_power[n]) * _gain;
+ _peak_power[n] = Session::compute_peak (output(n)->get_buffer(nframes) + offset, nframes, _peak_power[n]);
}
}
}