summaryrefslogtreecommitdiff
path: root/libs/ardour/io.cc
diff options
context:
space:
mode:
authorSampo Savolainen <v2@iki.fi>2006-09-05 17:53:54 +0000
committerSampo Savolainen <v2@iki.fi>2006-09-05 17:53:54 +0000
commitbabf75d871ee253fbe32c50737aa110a4fffa36f (patch)
tree604d9858a6fec9b039cd46ab39d9862a30db215d /libs/ardour/io.cc
parente513d106d7ecf7e629f55c6eb554a2638f9c6443 (diff)
Fix declicking for phase inverted routes by stopping
process_output_buffers() from inverting the phase of a buffer twice. Also fixed bug in apply_declick() which resulted in incorrect phases for even buffers of p-reversed routes. git-svn-id: svn://localhost/ardour2/trunk@906 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/io.cc')
-rw-r--r--libs/ardour/io.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc
index 494401b080..242d94c2d7 100644
--- a/libs/ardour/io.cc
+++ b/libs/ardour/io.cc
@@ -203,18 +203,21 @@ IO::apply_declick (vector<Sample *>& bufs, uint32_t nbufs, jack_nframes_t nframe
/* now ensure the rest of the buffer has the target value
applied, if necessary.
*/
-
+
if (declick != nframes) {
+ float this_target;
if (invert_polarity) {
- target = -target;
+ this_target = -target;
+ } else {
+ this_target = target;
}
- if (target == 0.0) {
+ if (this_target == 0.0) {
memset (&buffer[declick], 0, sizeof (Sample) * (nframes - declick));
- } else if (target != 1.0) {
+ } else if (this_target != 1.0) {
for (jack_nframes_t nx = declick; nx < nframes; ++nx) {
- buffer[nx] *= target;
+ buffer[nx] *= this_target;
}
}
}