Browse code

avfilter/vf_drawtext: Avoid using non public AV_PIX_FMT_NB

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2014/05/28 00:43:03
Showing 1 changed files
... ...
@@ -517,15 +517,14 @@ int ff_draw_round_to_sub(FFDrawContext *draw, int sub_dir, int round_dir,
517 517
 
518 518
 AVFilterFormats *ff_draw_supported_pixel_formats(unsigned flags)
519 519
 {
520
-    enum AVPixelFormat i, pix_fmts[AV_PIX_FMT_NB + 1];
521
-    unsigned n = 0;
520
+    enum AVPixelFormat i;
522 521
     FFDrawContext draw;
522
+    AVFilterFormats *fmts = NULL;
523 523
 
524
-    for (i = 0; i < AV_PIX_FMT_NB; i++)
524
+    for (i = 0; av_pix_fmt_desc_get(i); i++)
525 525
         if (ff_draw_init(&draw, i, flags) >= 0)
526
-            pix_fmts[n++] = i;
527
-    pix_fmts[n++] = AV_PIX_FMT_NONE;
528
-    return ff_make_format_list(pix_fmts);
526
+            ff_add_format(&fmts, i);
527
+    return fmts;
529 528
 }
530 529
 
531 530
 #ifdef TEST
... ...
@@ -540,7 +539,7 @@ int main(void)
540 540
     FFDrawColor color;
541 541
     int r, i;
542 542
 
543
-    for (f = 0; f < AV_PIX_FMT_NB; f++) {
543
+    for (f = 0; av_pix_fmt_desc_get(f); f++) {
544 544
         desc = av_pix_fmt_desc_get(f);
545 545
         if (!desc->name)
546 546
             continue;