summaryrefslogtreecommitdiff
path: root/libavfilter/af_bs2b.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavfilter/af_bs2b.c')
-rw-r--r--libavfilter/af_bs2b.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/libavfilter/af_bs2b.c b/libavfilter/af_bs2b.c
index 25e786761f..54d52c5c6e 100644
--- a/libavfilter/af_bs2b.c
+++ b/libavfilter/af_bs2b.c
@@ -1,18 +1,18 @@
/*
- * This file is part of Libav.
+ * This file is part of FFmpeg.
*
- * Libav is free software; you can redistribute it and/or
+ * FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
- * Libav is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
+ * License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@@ -47,7 +47,7 @@ typedef struct Bs2bContext {
#define OFFSET(x) offsetof(Bs2bContext, x)
#define A AV_OPT_FLAG_AUDIO_PARAM
-static const AVOption options[] = {
+static const AVOption bs2b_options[] = {
{ "profile", "Apply a pre-defined crossfeed level",
OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = BS2B_DEFAULT_CLEVEL }, 0, INT_MAX, A, "profile" },
{ "default", "default profile", 0, AV_OPT_TYPE_CONST, { .i64 = BS2B_DEFAULT_CLEVEL }, 0, 0, A, "profile" },
@@ -60,12 +60,7 @@ static const AVOption options[] = {
{ NULL },
};
-static const AVClass bs2b_class = {
- .class_name = "bs2b filter",
- .item_name = av_default_item_name,
- .option = options,
- .version = LIBAVUTIL_VERSION_INT,
-};
+AVFILTER_DEFINE_CLASS(bs2b);
static av_cold int init(AVFilterContext *ctx)
{
@@ -106,22 +101,25 @@ static int query_formats(AVFilterContext *ctx)
AV_SAMPLE_FMT_DBL,
AV_SAMPLE_FMT_NONE,
};
+ int ret;
if (ff_add_channel_layout(&layouts, AV_CH_LAYOUT_STEREO) != 0)
return AVERROR(ENOMEM);
- ff_set_common_channel_layouts(ctx, layouts);
+ ret = ff_set_common_channel_layouts(ctx, layouts);
+ if (ret < 0)
+ return ret;
formats = ff_make_format_list(sample_fmts);
if (!formats)
return AVERROR(ENOMEM);
- ff_set_common_formats(ctx, formats);
+ ret = ff_set_common_formats(ctx, formats);
+ if (ret < 0)
+ return ret;
formats = ff_all_samplerates();
if (!formats)
return AVERROR(ENOMEM);
- ff_set_common_samplerates(ctx, formats);
-
- return 0;
+ return ff_set_common_samplerates(ctx, formats);
}
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
@@ -168,16 +166,16 @@ static int config_output(AVFilterLink *outlink)
bs2b->filter = bs2b_cross_feed_u8;
break;
case AV_SAMPLE_FMT_S16:
- bs2b->filter = bs2b_cross_feed_s16;
+ bs2b->filter = (void*)bs2b_cross_feed_s16;
break;
case AV_SAMPLE_FMT_S32:
- bs2b->filter = bs2b_cross_feed_s32;
+ bs2b->filter = (void*)bs2b_cross_feed_s32;
break;
case AV_SAMPLE_FMT_FLT:
- bs2b->filter = bs2b_cross_feed_f;
+ bs2b->filter = (void*)bs2b_cross_feed_f;
break;
case AV_SAMPLE_FMT_DBL:
- bs2b->filter = bs2b_cross_feed_d;
+ bs2b->filter = (void*)bs2b_cross_feed_d;
break;
default:
return AVERROR_BUG;