diff options
author | Paul B Mahol <onemda@gmail.com> | 2021-01-16 21:08:08 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2021-01-16 21:35:44 +0100 |
commit | 60836fb6f642c20bb13f9528899d33757d8eaf27 (patch) | |
tree | 0e5878dd5e7deba24f783b0c5972cc5a2af0cfe7 | |
parent | 5b34fcaa8d12c5a5407b2154f8e743c71f9cdd57 (diff) | |
download | ffmpeg-60836fb6f642c20bb13f9528899d33757d8eaf27.tar.gz |
avfilter/vf_fieldhint: use ff_formats_pixdesc_filter()
-rw-r--r-- | libavfilter/vf_fieldhint.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/libavfilter/vf_fieldhint.c b/libavfilter/vf_fieldhint.c index c120bb01c3..dcd08dabc3 100644 --- a/libavfilter/vf_fieldhint.c +++ b/libavfilter/vf_fieldhint.c @@ -77,19 +77,16 @@ static av_cold int init(AVFilterContext *ctx) static int query_formats(AVFilterContext *ctx) { - AVFilterFormats *pix_fmts = NULL; - int fmt, ret; - - for (fmt = 0; av_pix_fmt_desc_get(fmt); fmt++) { - const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(fmt); - if (!(desc->flags & AV_PIX_FMT_FLAG_HWACCEL || - desc->flags & AV_PIX_FMT_FLAG_PAL || - desc->flags & AV_PIX_FMT_FLAG_BITSTREAM) && - (ret = ff_add_format(&pix_fmts, fmt)) < 0) - return ret; - } + AVFilterFormats *formats = NULL; + int ret; - return ff_set_common_formats(ctx, pix_fmts); + ret = ff_formats_pixdesc_filter(&formats, 0, + AV_PIX_FMT_FLAG_HWACCEL | + AV_PIX_FMT_FLAG_BITSTREAM | + AV_PIX_FMT_FLAG_PAL); + if (ret < 0) + return ret; + return ff_set_common_formats(ctx, formats); } static int config_input(AVFilterLink *inlink) |