Commit 1dd35611 authored by Anton Khirnov's avatar Anton Khirnov

vf_format: do not use the AVFilterFormats internals.

Use the formats.h API instead.
parent c5ab6088
...@@ -83,15 +83,17 @@ static av_cold int init(AVFilterContext *ctx) ...@@ -83,15 +83,17 @@ static av_cold int init(AVFilterContext *ctx)
static AVFilterFormats *make_format_list(FormatContext *s, int flag) static AVFilterFormats *make_format_list(FormatContext *s, int flag)
{ {
AVFilterFormats *formats; AVFilterFormats *formats = NULL;
enum AVPixelFormat pix_fmt; enum AVPixelFormat pix_fmt;
formats = av_mallocz(sizeof(AVFilterFormats));
formats->formats = av_malloc(sizeof(enum AVPixelFormat) * AV_PIX_FMT_NB);
for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++) for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++)
if (s->listed_pix_fmt_flags[pix_fmt] == flag) if (s->listed_pix_fmt_flags[pix_fmt] == flag) {
formats->formats[formats->nb_formats++] = pix_fmt; int ret = ff_add_format(&formats, pix_fmt);
if (ret < 0) {
ff_formats_unref(&formats);
return NULL;
}
}
return formats; return formats;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment