Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -84,16 +84,13 @@ AVFILTER_DEFINE_CLASS(il); · 83 unmodified lines | ||
| 84 | 84 | static int query_formats(AVFilterContext *ctx) |
| 85 | 85 | { |
| 86 | 86 | AVFilterFormats *formats = NULL; |
| 87 | − int fmt, ret; | |
| 88 | − | |
| 89 | − for (fmt = 0; av_pix_fmt_desc_get(fmt); fmt++) { | |
| 90 | − const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(fmt); | |
| 91 | − if (!(desc->flags & AV_PIX_FMT_FLAG_PAL) && | |
| 92 | − !(desc->flags & AV_PIX_FMT_FLAG_HWACCEL) && | |
| 93 | − (ret = ff_add_format(&formats, fmt)) < 0) | |
| 94 | − return ret; | |
| 95 | − } | |
| 87 | + int ret; | |
| 96 | 88 | |
| 89 | + ret = ff_formats_pixdesc_filter(&formats, 0, | |
| 90 | + AV_PIX_FMT_FLAG_PAL | | |
| 91 | + AV_PIX_FMT_FLAG_HWACCEL); | |
| 92 | + if (ret < 0) | |
| 93 | + return ret; | |
| 97 | 94 | return ff_set_common_formats(ctx, formats); |
| 98 | 95 | } |
| 99 | 96 | |