summaryrefslogtreecommitdiff
path: root/libs/ardour/disk_reader.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-11-21 02:54:19 +0100
committerRobin Gareus <robin@gareus.org>2019-11-21 02:54:19 +0100
commit53b1d17c60bc59d1d20c7d3486b76628eeedfc43 (patch)
tree23b29a02c5a12271d2b4c152c003c70cfdaccbcf /libs/ardour/disk_reader.cc
parent78d5e6af289ff0e05a0058d078b79d3cc4d1c27d (diff)
Fix multi-channel de-click
_declick_amp gain needs to be reset for each channel before the test (_declick_amp.gain() != target_gain) if de-clicking is needed.
Diffstat (limited to 'libs/ardour/disk_reader.cc')
-rw-r--r--libs/ardour/disk_reader.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/libs/ardour/disk_reader.cc b/libs/ardour/disk_reader.cc
index 325bdca974..b62fe04ecd 100644
--- a/libs/ardour/disk_reader.cc
+++ b/libs/ardour/disk_reader.cc
@@ -362,6 +362,11 @@ DiskReader::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
}
}
+ /* reset _declick_amp to the correct gain before processing this channel. */
+ if (declick_out) {
+ _declick_amp.set_gain (initial_declick_gain);
+ }
+
if (!declick_out) {
const samplecnt_t total = chaninfo->rbuf->read (disk_buf.data(), disk_samples_to_consume);
@@ -395,11 +400,6 @@ DiskReader::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
}
}
- /* reset _declick_amp to the correct gain before
- * processing this channel.
- */
-
- _declick_amp.set_gain (initial_declick_gain);
_declick_amp.apply_gain (disk_buf, nframes, target_gain);
/* _declick_amp is now left with the correct gain after