Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2022-03-15 17:34:57 +0300
committerPaul B Mahol <onemda@gmail.com>2022-03-15 18:07:57 +0300
commit07c16cdd949dacbf9efa153a0748da88d63198f0 (patch)
tree8b497dee64762dfd7ca52a24aa4396e0f8341bf3 /libavfilter/af_speechnorm.c
parentbd5da8ad96a0fb925df656782e8f544c5ffc4a7b (diff)
avfilter/af_speechnorm: fix regression in channels option processing
Diffstat (limited to 'libavfilter/af_speechnorm.c')
-rw-r--r--libavfilter/af_speechnorm.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/libavfilter/af_speechnorm.c b/libavfilter/af_speechnorm.c
index 0b46bec7b5..c9bd8d5cac 100644
--- a/libavfilter/af_speechnorm.c
+++ b/libavfilter/af_speechnorm.c
@@ -104,8 +104,8 @@ static const AVOption speechnorm_options[] = {
{ "r", "set the expansion raising amount", OFFSET(raise_amount), AV_OPT_TYPE_DOUBLE, {.dbl=0.001}, 0.0, 1.0, FLAGS },
{ "fall", "set the compression raising amount", OFFSET(fall_amount), AV_OPT_TYPE_DOUBLE, {.dbl=0.001}, 0.0, 1.0, FLAGS },
{ "f", "set the compression raising amount", OFFSET(fall_amount), AV_OPT_TYPE_DOUBLE, {.dbl=0.001}, 0.0, 1.0, FLAGS },
- { "channels", "set channels to filter", OFFSET(ch_layout_str), AV_OPT_TYPE_STRING, {.str="all"}, INT64_MIN, INT64_MAX, FLAGS },
- { "h", "set channels to filter", OFFSET(ch_layout_str), AV_OPT_TYPE_STRING, {.str="all"}, INT64_MIN, INT64_MAX, FLAGS },
+ { "channels", "set channels to filter", OFFSET(ch_layout_str), AV_OPT_TYPE_STRING, {.str="all"}, 0, 0, FLAGS },
+ { "h", "set channels to filter", OFFSET(ch_layout_str), AV_OPT_TYPE_STRING, {.str="all"}, 0, 0, FLAGS },
{ "invert", "set inverted filtering", OFFSET(invert), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
{ "i", "set inverted filtering", OFFSET(invert), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
{ "link", "set linked channels filtering", OFFSET(link), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
@@ -462,6 +462,13 @@ static int activate(AVFilterContext *ctx)
int ret, status;
int64_t pts;
+ ret = av_channel_layout_copy(&s->ch_layout, &inlink->ch_layout);
+ if (ret < 0)
+ return ret;
+ if (strcmp(s->ch_layout_str, "all"))
+ av_channel_layout_from_string(&s->ch_layout,
+ s->ch_layout_str);
+
FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
ret = filter_frame(ctx);
@@ -547,18 +554,6 @@ static int process_command(AVFilterContext *ctx, const char *cmd, const char *ar
return 0;
}
-static av_cold int init(AVFilterContext *ctx)
-{
- SpeechNormalizerContext *s = ctx->priv;
- int ret;
-
- if (strcmp(s->ch_layout_str, "all"))
- ret = av_channel_layout_from_string(&s->ch_layout,
- s->ch_layout_str);
-
- return ret;
-}
-
static av_cold void uninit(AVFilterContext *ctx)
{
SpeechNormalizerContext *s = ctx->priv;
@@ -589,7 +584,6 @@ const AVFilter ff_af_speechnorm = {
.priv_size = sizeof(SpeechNormalizerContext),
.priv_class = &speechnorm_class,
.activate = activate,
- .init = init,
.uninit = uninit,
FILTER_INPUTS(inputs),
FILTER_OUTPUTS(outputs),