]> git.sesse.net Git - ffmpeg/commitdiff
lavfi/aiir: Refine the pad/vpad related operation
authorJun Zhao <barryjzhao@tencent.com>
Mon, 25 May 2020 08:10:29 +0000 (16:10 +0800)
committerJun Zhao <barryjzhao@tencent.com>
Sat, 30 May 2020 11:02:43 +0000 (19:02 +0800)
move the pad/vpad related operation with more natural
coding style.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
libavfilter/af_aiir.c

index 503d5b93294b270dd859a48b34adbe0962ef57d4..214c998348c80e105ac84860af6dc2769703855b 100644 (file)
@@ -1180,6 +1180,10 @@ static av_cold int init(AVFilterContext *ctx)
     if (!pad.name)
         return AVERROR(ENOMEM);
 
+    ret = ff_insert_outpad(ctx, 0, &pad);
+    if (ret < 0)
+        return ret;
+
     if (s->response) {
         vpad = (AVFilterPad){
             .name         = av_strdup("filter_response"),
@@ -1188,13 +1192,7 @@ static av_cold int init(AVFilterContext *ctx)
         };
         if (!vpad.name)
             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);
         if (ret < 0)
             return ret;