diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-05-27 02:54:58 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-05-27 02:54:58 +0200 |
commit | de5ec08825918401b604d13c4c49bf6bef01ceb3 (patch) | |
tree | a1033e948eb6a35a889df9bd010f2eb565d9b0a8 | |
parent | a37f2cc5797a9bd09e535f3353d1a6be0e0cfcf4 (diff) | |
parent | 862f33c10ea38ea49fa4188725df5e5246dbd1d8 (diff) |
Merge commit '862f33c10ea38ea49fa4188725df5e5246dbd1d8'
* commit '862f33c10ea38ea49fa4188725df5e5246dbd1d8':
vf_scale: use the pixfmt descriptor API
Conflicts:
libavfilter/vf_scale.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavfilter/vf_scale.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c index b1d97af4e0..c4605c72ce 100644 --- a/libavfilter/vf_scale.c +++ b/libavfilter/vf_scale.c @@ -178,25 +178,31 @@ static int query_formats(AVFilterContext *ctx) int ret; if (ctx->inputs[0]) { + const AVPixFmtDescriptor *desc = NULL; formats = NULL; - for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++) + while ((desc = av_pix_fmt_desc_next(desc))) { + pix_fmt = av_pix_fmt_desc_get_id(desc); if ((sws_isSupportedInput(pix_fmt) || sws_isSupportedEndiannessConversion(pix_fmt)) && (ret = ff_add_format(&formats, pix_fmt)) < 0) { ff_formats_unref(&formats); return ret; } + } ff_formats_ref(formats, &ctx->inputs[0]->out_formats); } if (ctx->outputs[0]) { + const AVPixFmtDescriptor *desc = NULL; formats = NULL; - for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++) + while ((desc = av_pix_fmt_desc_next(desc))) { + pix_fmt = av_pix_fmt_desc_get_id(desc); if ((sws_isSupportedOutput(pix_fmt) || pix_fmt == AV_PIX_FMT_PAL8 || sws_isSupportedEndiannessConversion(pix_fmt)) && (ret = ff_add_format(&formats, pix_fmt)) < 0) { ff_formats_unref(&formats); return ret; } + } ff_formats_ref(formats, &ctx->outputs[0]->in_formats); } |