avfilter/adynamicequalizer_template: refactor and improve output
This commit is contained in:
@@ -96,26 +96,16 @@ static int config_input(AVFilterLink *inlink)
|
||||
AudioDynamicEqualizerContext *s = ctx->priv;
|
||||
|
||||
s->format = inlink->format;
|
||||
s->state = ff_get_audio_buffer(inlink, 8);
|
||||
s->state = ff_get_audio_buffer(inlink, 16);
|
||||
if (!s->state)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
switch (s->format) {
|
||||
case AV_SAMPLE_FMT_DBLP:
|
||||
for (int ch = 0; ch < inlink->ch_layout.nb_channels; ch++) {
|
||||
double *state = (double *)s->state->extended_data[ch];
|
||||
|
||||
state[4] = 1.;
|
||||
}
|
||||
s->filter_prepare = filter_prepare_double;
|
||||
s->filter_channels = filter_channels_double;
|
||||
break;
|
||||
case AV_SAMPLE_FMT_FLTP:
|
||||
for (int ch = 0; ch < inlink->ch_layout.nb_channels; ch++) {
|
||||
float *state = (float *)s->state->extended_data[ch];
|
||||
|
||||
state[4] = 1.;
|
||||
}
|
||||
s->filter_prepare = filter_prepare_float;
|
||||
s->filter_channels = filter_channels_float;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user