X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavfilter%2Fvf_detelecine.c;h=e345e3062ab370223651aed2be7bb31f75c94f81;hb=bd96c54fe4819b3ca9a975e2083d67f4443c559b;hp=0199214c3ee95f6caa17a71a3f336f13562efa97;hpb=409e684e79b6ee0c511292326f09b13fe230e58e;p=ffmpeg diff --git a/libavfilter/vf_detelecine.c b/libavfilter/vf_detelecine.c index 0199214c3ee..e345e3062ab 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) @@ -375,7 +372,7 @@ static const AVFilterPad detelecine_outputs[] = { { NULL } }; -AVFilter ff_vf_detelecine = { +const AVFilter ff_vf_detelecine = { .name = "detelecine", .description = NULL_IF_CONFIG_SMALL("Apply an inverse telecine pattern."), .priv_size = sizeof(DetelecineContext),