diff options
author | Paul B Mahol <onemda@gmail.com> | 2021-01-16 21:28:33 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2021-01-16 21:35:44 +0100 |
commit | 4ae2dfd7ea2f95deaa91c6072ac9d36c4810d36e (patch) | |
tree | 2e0732e44103dd6b33cefacb2c464c0443f4ba93 /libavfilter | |
parent | bc2632f867827d68fa4506c404d719062b82d225 (diff) | |
download | ffmpeg-4ae2dfd7ea2f95deaa91c6072ac9d36c4810d36e.tar.gz |
avfilter/vf_detelecine: use ff_formats_pixdesc_filter()
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/vf_detelecine.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/libavfilter/vf_detelecine.c b/libavfilter/vf_detelecine.c index 0199214c3e..f02f85d602 100644 --- a/libavfilter/vf_detelecine.c +++ b/libavfilter/vf_detelecine.c @@ -124,19 +124,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_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) |