From 53b1d17c60bc59d1d20c7d3486b76628eeedfc43 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 21 Nov 2019 02:54:19 +0100 Subject: 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. --- libs/ardour/disk_reader.cc | 10 +++++----- 1 file 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 -- cgit v1.2.3