13
0

Fix peak-meter atomics (amend 4ba4cd69ff)

This commit is contained in:
Robin Gareus 2023-03-26 20:37:25 +02:00
parent bc9ac3bdb4
commit e36938f305
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -99,6 +99,7 @@ PeakMeter::run (BufferSet& bufs, samplepos_t /*start_sample*/, samplepos_t /*end
int canderef (1);
const bool reset_max = _reset_max.compare_exchange_strong (canderef, 0);
/* max-peak is set from DPM's peak-buffer, so DPM also needs to be reset in sync */
canderef = 1;
const bool reset_dpm = _reset_dpm.compare_exchange_strong (canderef, 0) || reset_max;
const uint32_t n_audio = min (current_meters.n_audio (), bufs.count ().n_audio ());