13
0

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.
This commit is contained in:
Robin Gareus 2019-11-21 02:54:19 +01:00
parent 78d5e6af28
commit 53b1d17c60
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -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