mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-10-30 22:38:30 +08:00
obs-filters: Fix expander and upward compressor above threshold
Fixes behaviours above threshold for expander and upward compressor. Fixes issues #8052 & #8030 . Signed-off-by: pkv <pkv@obsproject.com>
This commit is contained in:
@@ -379,14 +379,11 @@ static inline void process_sample(size_t idx, float *samples, float *env_buf,
|
||||
/* --------------------------------- */
|
||||
/* output */
|
||||
|
||||
float min_val =
|
||||
is_upwcomp ? fminf(diff, threshold - mul_to_db(samples[idx]))
|
||||
: 0.0f;
|
||||
gain = db_to_mul(fminf(min_val, gain_db[idx]));
|
||||
|
||||
// above threshold, don't process expander nor upward compressor
|
||||
if (threshold - env_db <= 0)
|
||||
gain = 1.0f;
|
||||
if (!is_upwcomp) {
|
||||
gain = db_to_mul(fminf(0, gain_db[idx]));
|
||||
} else {
|
||||
gain = db_to_mul(gain_db[idx]);
|
||||
}
|
||||
|
||||
samples[idx] *= gain * output_gain;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user