diff options
author | Paul B Mahol <onemda@gmail.com> | 2022-11-18 12:56:10 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2022-11-18 12:58:09 +0100 |
commit | 3e6816514c5a0f56b7028c429bd8a371cac7f8e3 (patch) | |
tree | c0136232de47fe45e5cb383e14725432dca2faae /libavfilter/af_surround.c | |
parent | 193270ee87d8e5a4b193d36ae50d29a4f0038c6d (diff) |
avfilter/af_surround: fix regression with channel i/o gain
Diffstat (limited to 'libavfilter/af_surround.c')
-rw-r--r-- | libavfilter/af_surround.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libavfilter/af_surround.c b/libavfilter/af_surround.c index 9a589645ca..ed1bb3f9af 100644 --- a/libavfilter/af_surround.c +++ b/libavfilter/af_surround.c @@ -196,30 +196,30 @@ static void set_input_levels(AVFilterContext *ctx) { AudioSurroundContext *s = ctx->priv; + for (int ch = 0; ch < s->nb_in_channels && s->level_in >= 0.f; ch++) + s->input_levels[ch] = s->level_in; + s->level_in = -1.f; + for (int n = 0; n < SC_NB; n++) { const int ch = av_channel_layout_index_from_channel(&s->in_ch_layout, ch_map[n]); if (ch >= 0) s->input_levels[ch] = s->f_i[n]; } - - for (int ch = 0; ch < s->nb_in_channels && s->level_in >= 0.f; ch++) - s->input_levels[ch] = s->level_in; - s->level_in = -1.f; } static void set_output_levels(AVFilterContext *ctx) { AudioSurroundContext *s = ctx->priv; + for (int ch = 0; ch < s->nb_out_channels && s->level_out >= 0.f; ch++) + s->output_levels[ch] = s->level_out; + s->level_out = -1.f; + for (int n = 0; n < SC_NB; n++) { const int ch = av_channel_layout_index_from_channel(&s->out_ch_layout, ch_map[n]); if (ch >= 0) s->output_levels[ch] = s->f_o[n]; } - - for (int ch = 0; ch < s->nb_out_channels && s->level_out >= 0.f; ch++) - s->output_levels[ch] = s->level_out; - s->level_out = -1.f; } static int config_input(AVFilterLink *inlink) |