avfilter/af_join: remove now unnecessary goto
Options are freed from the generic code now, there is no need to call av_opt_free() from the filter. Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
parent
85b56e4803
commit
162e22e144
@ -189,18 +189,15 @@ static av_cold int join_init(AVFilterContext *ctx)
|
|||||||
if (!(s->channel_layout = av_get_channel_layout(s->channel_layout_str))) {
|
if (!(s->channel_layout = av_get_channel_layout(s->channel_layout_str))) {
|
||||||
av_log(ctx, AV_LOG_ERROR, "Error parsing channel layout '%s'.\n",
|
av_log(ctx, AV_LOG_ERROR, "Error parsing channel layout '%s'.\n",
|
||||||
s->channel_layout_str);
|
s->channel_layout_str);
|
||||||
ret = AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
goto fail;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
s->nb_channels = av_get_channel_layout_nb_channels(s->channel_layout);
|
s->nb_channels = av_get_channel_layout_nb_channels(s->channel_layout);
|
||||||
s->channels = av_mallocz(sizeof(*s->channels) * s->nb_channels);
|
s->channels = av_mallocz(sizeof(*s->channels) * s->nb_channels);
|
||||||
s->buffers = av_mallocz(sizeof(*s->buffers) * s->nb_channels);
|
s->buffers = av_mallocz(sizeof(*s->buffers) * s->nb_channels);
|
||||||
s->input_frames = av_mallocz(sizeof(*s->input_frames) * s->inputs);
|
s->input_frames = av_mallocz(sizeof(*s->input_frames) * s->inputs);
|
||||||
if (!s->channels || !s->buffers|| !s->input_frames) {
|
if (!s->channels || !s->buffers|| !s->input_frames)
|
||||||
ret = AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < s->nb_channels; i++) {
|
for (i = 0; i < s->nb_channels; i++) {
|
||||||
s->channels[i].out_channel = av_channel_layout_extract_channel(s->channel_layout, i);
|
s->channels[i].out_channel = av_channel_layout_extract_channel(s->channel_layout, i);
|
||||||
@ -208,7 +205,7 @@ static av_cold int join_init(AVFilterContext *ctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((ret = parse_maps(ctx)) < 0)
|
if ((ret = parse_maps(ctx)) < 0)
|
||||||
goto fail;
|
return ret;
|
||||||
|
|
||||||
for (i = 0; i < s->inputs; i++) {
|
for (i = 0; i < s->inputs; i++) {
|
||||||
char name[32];
|
char name[32];
|
||||||
@ -224,9 +221,7 @@ static av_cold int join_init(AVFilterContext *ctx)
|
|||||||
ff_insert_inpad(ctx, i, &pad);
|
ff_insert_inpad(ctx, i, &pad);
|
||||||
}
|
}
|
||||||
|
|
||||||
fail:
|
return 0;
|
||||||
av_opt_free(s);
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static av_cold void join_uninit(AVFilterContext *ctx)
|
static av_cold void join_uninit(AVFilterContext *ctx)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user