avfilter/vf_hflip: Don't call av_pix_fmt_desc_get() twice
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
Sat, 11 Sep 2021 13:07:49 +0000 (15:07 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
Sun, 19 Sep 2021 03:18:51 +0000 (05:18 +0200)
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
libavfilter/vf_hflip.c

index 7b5650a..fa3fd72 100644 (file)
@@ -46,10 +46,10 @@ AVFILTER_DEFINE_CLASS(hflip);
 static int query_formats(AVFilterContext *ctx)
 {
     AVFilterFormats *pix_fmts = NULL;
+    const AVPixFmtDescriptor *desc;
     int fmt, ret;
 
-    for (fmt = 0; av_pix_fmt_desc_get(fmt); fmt++) {
-        const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(fmt);
+    for (fmt = 0; desc = av_pix_fmt_desc_get(fmt); fmt++) {
         if (!(desc->flags & AV_PIX_FMT_FLAG_HWACCEL ||
               desc->flags & AV_PIX_FMT_FLAG_BITSTREAM ||
               (desc->log2_chroma_w != desc->log2_chroma_h &&