diff options
author | Paul B Mahol <onemda@gmail.com> | 2021-01-16 21:20:31 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2021-01-16 21:35:44 +0100 |
commit | 6baed9ce03d8abebc0f33d8c633224322e4a0bfd (patch) | |
tree | cd3dd4f50531a0f5304e617bb8417a73944ebc84 /libavfilter/vf_telecine.c | |
parent | 737bb01540b37b97cd7f50923ca13e776c4f9ab0 (diff) | |
download | ffmpeg-6baed9ce03d8abebc0f33d8c633224322e4a0bfd.tar.gz |
avfilter/vf_telecine: use ff_formats_pixdesc_filter()
Diffstat (limited to 'libavfilter/vf_telecine.c')
-rw-r--r-- | libavfilter/vf_telecine.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/libavfilter/vf_telecine.c b/libavfilter/vf_telecine.c index 741b19a4f1..6563b49725 100644 --- a/libavfilter/vf_telecine.c +++ b/libavfilter/vf_telecine.c @@ -101,19 +101,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; - } - - return ff_set_common_formats(ctx, pix_fmts); + AVFilterFormats *formats = NULL; + int ret; + + ret = ff_formats_pixdesc_filter(&formats, 0, + AV_PIX_FMT_FLAG_BITSTREAM | + AV_PIX_FMT_FLAG_PAL | + AV_PIX_FMT_FLAG_HWACCEL); + if (ret < 0) + return ret; + return ff_set_common_formats(ctx, formats); } static int config_input(AVFilterLink *inlink) |