summaryrefslogtreecommitdiff
path: root/libs/ardour/disk_reader.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2019-11-18 21:38:25 -0700
committerPaul Davis <paul@linuxaudiosystems.com>2019-11-18 21:45:39 -0700
commit9b92084ed69aa03957a793be92122de2608cd852 (patch)
tree4083d2d6003d500b315bdd8051abaab4f4638cf5 /libs/ardour/disk_reader.cc
parent530a4393dc0004996a1979c855e2363b8fd8e0a2 (diff)
DiskReader::_declick_amp needs to repeat the same work for each audio channel handled
Diffstat (limited to 'libs/ardour/disk_reader.cc')
-rw-r--r--libs/ardour/disk_reader.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/libs/ardour/disk_reader.cc b/libs/ardour/disk_reader.cc
index 099ec72ba9..cc4748f7fb 100644
--- a/libs/ardour/disk_reader.cc
+++ b/libs/ardour/disk_reader.cc
@@ -344,6 +344,8 @@ DiskReader::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
scaling = 1.0;
}
+ const float initial_declick_gain = _declick_amp.gain ();
+
for (n = 0, chan = c->begin(); chan != c->end(); ++chan, ++n) {
ChannelInfo* chaninfo (*chan);
@@ -390,8 +392,17 @@ 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
+ * processing nframes
+ */
+
Amp::apply_simple_gain (disk_buf, nframes, scaling);
if (ms & MonitoringInput) {