diff options
author | Paul B Mahol <onemda@gmail.com> | 2015-12-03 12:01:50 +0300 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2015-12-03 13:07:52 +0300 |
commit | 1b22bdf4e3506f889025044d02b9505988a8507a (patch) | |
tree | 1534da2b4335c532fe28a9f3bf5b02c323090bfd /libavfilter/af_agate.c | |
parent | 6907046130ee03a4c78f0a8ccafebcdde0a9c2cb (diff) |
avfilter/af_agate: compile agate only when requested.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter/af_agate.c')
-rw-r--r-- | libavfilter/af_agate.c | 62 |
1 files changed, 33 insertions, 29 deletions
diff --git a/libavfilter/af_agate.c b/libavfilter/af_agate.c index 39c0f15d8e..142ac63f96 100644 --- a/libavfilter/af_agate.c +++ b/libavfilter/af_agate.c @@ -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 |