diff options
author | Paul B Mahol <onemda@gmail.com> | 2021-01-16 21:24:43 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2021-01-16 21:35:44 +0100 |
commit | bc2632f867827d68fa4506c404d719062b82d225 (patch) | |
tree | d2f0c90eb4563b0352b42371d009ae192a673591 | |
parent | 6baed9ce03d8abebc0f33d8c633224322e4a0bfd (diff) | |
download | ffmpeg-bc2632f867827d68fa4506c404d719062b82d225.tar.gz |
avfilter/vf_mix: use ff_formats_pixdesc_filter()
-rw-r--r-- | libavfilter/vf_mix.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/libavfilter/vf_mix.c b/libavfilter/vf_mix.c index bdb67d8e5a..1ae73124f6 100644 --- a/libavfilter/vf_mix.c +++ b/libavfilter/vf_mix.c @@ -55,19 +55,16 @@ typedef struct MixContext { 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_PAL || - desc->flags & AV_PIX_FMT_FLAG_HWACCEL || - 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 av_cold int init(AVFilterContext *ctx) |