[FFmpeg-cvslog] lavd: do not use av_pix_fmt_descriptors directly

Paul B Mahol git at videolan.org
Fri Oct 12 18:04:26 CEST 2012


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Fri Oct 12 15:56:34 2012 +0000| [82eba2266739dcd64f01ac22283c9bfa46607512] | committer: Paul B Mahol

lavd: do not use av_pix_fmt_descriptors directly

Signed-off-by: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=82eba2266739dcd64f01ac22283c9bfa46607512
---

 libavdevice/caca.c  |    2 +-
 libavdevice/lavfi.c |    9 ++++++---
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/libavdevice/caca.c b/libavdevice/caca.c
index 6cd0306..dd20ba3 100644
--- a/libavdevice/caca.c
+++ b/libavdevice/caca.c
@@ -140,7 +140,7 @@ static int caca_write_header(AVFormatContext *s)
         goto fail;
     }
 
-    bpp = av_get_bits_per_pixel(&av_pix_fmt_descriptors[encctx->pix_fmt]);
+    bpp = av_get_bits_per_pixel(av_pix_fmt_desc_get(avctx->pix_fmt));
     c->dither = caca_create_dither(bpp, encctx->width, encctx->height,
                                    bpp / 8 * encctx->width,
                                    0x0000ff, 0x00ff00, 0xff0000, 0);
diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
index 860c055..944794f 100644
--- a/libavdevice/lavfi.c
+++ b/libavdevice/lavfi.c
@@ -54,14 +54,17 @@ static int *create_all_formats(int n)
 {
     int i, j, *fmts, count = 0;
 
-    for (i = 0; i < n; i++)
-        if (!(av_pix_fmt_descriptors[i].flags & PIX_FMT_HWACCEL))
+    for (i = 0; i < n; i++) {
+        const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(i);
+        if (!(desc->flags & PIX_FMT_HWACCEL))
             count++;
+    }
 
     if (!(fmts = av_malloc((count+1) * sizeof(int))))
         return NULL;
     for (j = 0, i = 0; i < n; i++) {
-        if (!(av_pix_fmt_descriptors[i].flags & PIX_FMT_HWACCEL))
+        const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(i);
+        if (!(desc->flags & PIX_FMT_HWACCEL))
             fmts[j++] = i;
     }
     fmts[j] = -1;



More information about the ffmpeg-cvslog mailing list