aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2014-05-24 11:15:15 +0200
committerAnton Khirnov <anton@khirnov.net>2014-05-26 22:25:26 +0200
commita7d070acb55c3ebbdd5e93e3366f32865732b8a3 (patch)
tree5052ab87d722421722c8bc46d6f3f8254f24ced2
parent862f33c10ea38ea49fa4188725df5e5246dbd1d8 (diff)
downloadffmpeg-a7d070acb55c3ebbdd5e93e3366f32865732b8a3.tar.gz
vf_fieldorder: avoid using AV_PIX_FMT_NB
That hardcodes the number of pixel formats into lavfi and will break when a shared lavu is updated, adding new pixel formats.
-rw-r--r--libavfilter/vf_fieldorder.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavfilter/vf_fieldorder.c b/libavfilter/vf_fieldorder.c
index a4df87f1a4..c05d08154e 100644
--- a/libavfilter/vf_fieldorder.c
+++ b/libavfilter/vf_fieldorder.c
@@ -50,9 +50,10 @@ static int query_formats(AVFilterContext *ctx)
/** accept any input pixel format that is not hardware accelerated, not
* a bitstream format, and does not have vertically sub-sampled chroma */
if (ctx->inputs[0]) {
+ const AVPixFmtDescriptor *desc = NULL;
formats = NULL;
- for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++) {
- const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
+ while ((desc = av_pix_fmt_desc_next(desc))) {
+ pix_fmt = av_pix_fmt_desc_get_id(desc);
if (!(desc->flags & AV_PIX_FMT_FLAG_HWACCEL ||
desc->flags & AV_PIX_FMT_FLAG_BITSTREAM) &&
desc->nb_components && !desc->log2_chroma_h &&