[FFmpeg-devel] [PATCH 4/8] avfilter/vf_scale: Remove always-true checks

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Tue Oct 5 23:53:44 EEST 2021


Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavfilter/vf_scale.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c
index 5411289894..993fd18620 100644
--- a/libavfilter/vf_scale.c
+++ b/libavfilter/vf_scale.c
@@ -344,7 +344,6 @@ static int query_formats(AVFilterContext *ctx)
     enum AVPixelFormat pix_fmt;
     int ret;
 
-    if (ctx->inputs[0]) {
         const AVPixFmtDescriptor *desc = NULL;
         formats = NULL;
         while ((desc = av_pix_fmt_desc_next(desc))) {
@@ -357,9 +356,8 @@ static int query_formats(AVFilterContext *ctx)
         }
         if ((ret = ff_formats_ref(formats, &ctx->inputs[0]->outcfg.formats)) < 0)
             return ret;
-    }
-    if (ctx->outputs[0]) {
-        const AVPixFmtDescriptor *desc = NULL;
+
+        desc    = NULL;
         formats = NULL;
         while ((desc = av_pix_fmt_desc_next(desc))) {
             pix_fmt = av_pix_fmt_desc_get_id(desc);
@@ -371,7 +369,6 @@ static int query_formats(AVFilterContext *ctx)
         }
         if ((ret = ff_formats_ref(formats, &ctx->outputs[0]->incfg.formats)) < 0)
             return ret;
-    }
 
     return 0;
 }
-- 
2.30.2



More information about the ffmpeg-devel mailing list