Commit 1b22bdf4 authored by Paul B Mahol's avatar Paul B Mahol

avfilter/af_agate: compile agate only when requested.

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 69070461
......@@ -79,35 +79,6 @@ static const AVOption options[] = {
{ NULL }
};
#define agate_options options
AVFILTER_DEFINE_CLASS(agate);
static int query_formats(AVFilterContext *ctx)
{
AVFilterFormats *formats = NULL;
AVFilterChannelLayouts *layouts;
int ret;
if ((ret = ff_add_format(&formats, AV_SAMPLE_FMT_DBL)) < 0)
return ret;
ret = ff_set_common_formats(ctx, formats);
if (ret < 0)
return ret;
layouts = ff_all_channel_counts();
if (!layouts)
return AVERROR(ENOMEM);
ret = ff_set_common_channel_layouts(ctx, layouts);
if (ret < 0)
return ret;
formats = ff_all_samplerates();
if (!formats)
return AVERROR(ENOMEM);
return ff_set_common_samplerates(ctx, formats);
}
static int agate_config_input(AVFilterLink *inlink)
{
AVFilterContext *ctx = inlink->dst;
......@@ -197,6 +168,37 @@ static void gate(AudioGateContext *s,
}
}
#if CONFIG_AGATE_FILTER
#define agate_options options
AVFILTER_DEFINE_CLASS(agate);
static int query_formats(AVFilterContext *ctx)
{
AVFilterFormats *formats = NULL;
AVFilterChannelLayouts *layouts;
int ret;
if ((ret = ff_add_format(&formats, AV_SAMPLE_FMT_DBL)) < 0)
return ret;
ret = ff_set_common_formats(ctx, formats);
if (ret < 0)
return ret;
layouts = ff_all_channel_counts();
if (!layouts)
return AVERROR(ENOMEM);
ret = ff_set_common_channel_layouts(ctx, layouts);
if (ret < 0)
return ret;
formats = ff_all_samplerates();
if (!formats)
return AVERROR(ENOMEM);
return ff_set_common_samplerates(ctx, formats);
}
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
{
const double *src = (const double *)in->data[0];
......@@ -254,6 +256,8 @@ AVFilter ff_af_agate = {
.outputs = outputs,
};
#endif /* CONFIG_AGATE_FILTER */
#if CONFIG_SIDECHAINGATE_FILTER
#define sidechaingate_options options
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment