aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/af_dynaudnorm.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2020-01-11 14:08:52 +0100
committerPaul B Mahol <onemda@gmail.com>2020-01-11 14:08:52 +0100
commitb650046860d3390de9fd3a9ffef28e36a9a6138e (patch)
tree5997c7018568000a72d2444a210d050882b1d967 /libavfilter/af_dynaudnorm.c
parentdd39dbf9839cf86ebc8e1943855ea2ee36a4160f (diff)
downloadffmpeg-b650046860d3390de9fd3a9ffef28e36a9a6138e.tar.gz
avfilter/af_dynaudnorm: use better limits for maximal amplification
Fixes regression in smoothness of amplification.
Diffstat (limited to 'libavfilter/af_dynaudnorm.c')
-rw-r--r--libavfilter/af_dynaudnorm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavfilter/af_dynaudnorm.c b/libavfilter/af_dynaudnorm.c
index db91d28b36..365453d60d 100644
--- a/libavfilter/af_dynaudnorm.c
+++ b/libavfilter/af_dynaudnorm.c
@@ -521,10 +521,11 @@ static void update_gain_history(DynamicAudioNormalizerContext *s, int channel,
}
while (cqueue_size(s->gain_history_minimum[channel]) >= s->filter_size) {
- double smoothed;
+ double smoothed, limit;
smoothed = gaussian_filter(s, s->gain_history_minimum[channel], s->threshold_history[channel]);
- smoothed = FFMIN(smoothed, cqueue_peek(s->gain_history_minimum[channel], s->filter_size / 2));
+ limit = cqueue_peek(s->gain_history_original[channel], 0);
+ smoothed = FFMIN(smoothed, limit);
cqueue_enqueue(s->gain_history_smoothed[channel], smoothed);