summaryrefslogtreecommitdiff
path: root/libavfilter/af_lv2.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2021-08-31 11:03:14 -0300
committerJames Almer <jamrial@gmail.com>2022-03-15 09:42:46 -0300
commit1f96db959c1235bb7079d354e09914a0a2608f62 (patch)
tree21ac480d5b148c0524761853e6badb3a90a7ca3f /libavfilter/af_lv2.c
parent8a5896ec1f635ccf0d726f7ba7a06649ebeebf25 (diff)
avfilter: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavfilter/af_lv2.c')
-rw-r--r--libavfilter/af_lv2.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/libavfilter/af_lv2.c b/libavfilter/af_lv2.c
index 0c23adeb15..3cdf16457c 100644
--- a/libavfilter/af_lv2.c
+++ b/libavfilter/af_lv2.c
@@ -288,8 +288,14 @@ static int config_output(AVFilterLink *outlink)
outlink->format = inlink->format;
outlink->sample_rate = sample_rate = inlink->sample_rate;
if (s->nb_inputs == s->nb_outputs) {
+ int ret;
+ if ((ret = av_channel_layout_copy(&outlink->ch_layout, &inlink->ch_layout)) < 0)
+ return ret;
+#if FF_API_OLD_CHANNEL_LAYOUT
+FF_DISABLE_DEPRECATION_WARNINGS
outlink->channel_layout = inlink->channel_layout;
- outlink->channels = inlink->channels;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
}
} else {
@@ -496,7 +502,7 @@ static int query_formats(AVFilterContext *ctx)
if (s->nb_inputs == 2 && s->nb_outputs == 2) {
layouts = NULL;
- ret = ff_add_channel_layout(&layouts, AV_CH_LAYOUT_STEREO);
+ ret = ff_add_channel_layout(&layouts, &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO);
if (ret < 0)
return ret;
ret = ff_set_common_channel_layouts(ctx, layouts);
@@ -505,10 +511,10 @@ static int query_formats(AVFilterContext *ctx)
} else {
if (s->nb_inputs >= 1) {
AVFilterLink *inlink = ctx->inputs[0];
- uint64_t inlayout = FF_COUNT2LAYOUT(s->nb_inputs);
+ AVChannelLayout inlayout = FF_COUNT2LAYOUT(s->nb_inputs);
layouts = NULL;
- ret = ff_add_channel_layout(&layouts, inlayout);
+ ret = ff_add_channel_layout(&layouts, &inlayout);
if (ret < 0)
return ret;
ret = ff_channel_layouts_ref(layouts, &inlink->outcfg.channel_layouts);
@@ -523,10 +529,10 @@ static int query_formats(AVFilterContext *ctx)
}
if (s->nb_outputs >= 1) {
- uint64_t outlayout = FF_COUNT2LAYOUT(s->nb_outputs);
+ AVChannelLayout outlayout = FF_COUNT2LAYOUT(s->nb_outputs);
layouts = NULL;
- ret = ff_add_channel_layout(&layouts, outlayout);
+ ret = ff_add_channel_layout(&layouts, &outlayout);
if (ret < 0)
return ret;
ret = ff_channel_layouts_ref(layouts, &outlink->incfg.channel_layouts);