summaryrefslogtreecommitdiff
path: root/libavfilter/drawutils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-05-27 17:43:03 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-05-27 17:52:24 +0200
commit0d26264fb4c8fbf3f26692270e77f71633d4b103 (patch)
tree94061ad8e2cf5c315d2eb46234afae948b643924 /libavfilter/drawutils.c
parentee0c91cc6582453b2e730f3a46e15ec5f1fa2273 (diff)
downloadffmpeg-0d26264fb4c8fbf3f26692270e77f71633d4b103.tar.gz
avfilter/vf_drawtext: Avoid using non public AV_PIX_FMT_NB
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/drawutils.c')
-rw-r--r--libavfilter/drawutils.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c
index a5064f8e7c..4437c2cfc8 100644
--- a/libavfilter/drawutils.c
+++ b/libavfilter/drawutils.c
@@ -517,15 +517,14 @@ int ff_draw_round_to_sub(FFDrawContext *draw, int sub_dir, int round_dir,
AVFilterFormats *ff_draw_supported_pixel_formats(unsigned flags)
{
- enum AVPixelFormat i, pix_fmts[AV_PIX_FMT_NB + 1];
- unsigned n = 0;
+ enum AVPixelFormat i;
FFDrawContext draw;
+ AVFilterFormats *fmts = NULL;
- for (i = 0; i < AV_PIX_FMT_NB; i++)
+ for (i = 0; av_pix_fmt_desc_get(i); i++)
if (ff_draw_init(&draw, i, flags) >= 0)
- pix_fmts[n++] = i;
- pix_fmts[n++] = AV_PIX_FMT_NONE;
- return ff_make_format_list(pix_fmts);
+ ff_add_format(&fmts, i);
+ return fmts;
}
#ifdef TEST
@@ -540,7 +539,7 @@ int main(void)
FFDrawColor color;
int r, i;
- for (f = 0; f < AV_PIX_FMT_NB; f++) {
+ for (f = 0; av_pix_fmt_desc_get(f); f++) {
desc = av_pix_fmt_desc_get(f);
if (!desc->name)
continue;