lavfi/aiir: Refine the pad/vpad related operation

move the pad/vpad related operation with more natural
coding style.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
This commit is contained in:
Jun Zhao 2020-05-25 16:10:29 +08:00
parent ff8329a730
commit 018cd437f8
1 changed files with 4 additions and 6 deletions

View File

@ -1180,6 +1180,10 @@ static av_cold int init(AVFilterContext *ctx)
if (!pad.name) if (!pad.name)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
ret = ff_insert_outpad(ctx, 0, &pad);
if (ret < 0)
return ret;
if (s->response) { if (s->response) {
vpad = (AVFilterPad){ vpad = (AVFilterPad){
.name = av_strdup("filter_response"), .name = av_strdup("filter_response"),
@ -1188,13 +1192,7 @@ static av_cold int init(AVFilterContext *ctx)
}; };
if (!vpad.name) if (!vpad.name)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
}
ret = ff_insert_outpad(ctx, 0, &pad);
if (ret < 0)
return ret;
if (s->response) {
ret = ff_insert_outpad(ctx, 1, &vpad); ret = ff_insert_outpad(ctx, 1, &vpad);
if (ret < 0) if (ret < 0)
return ret; return ret;