[FFmpeg-devel] [PATCH 3/3] Use named constants defined in targa.h.

Stefano Sabatini stefano.sabatini-lala
Wed Oct 13 01:24:25 CEST 2010


---
 libavcodec/targaenc.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/targaenc.c b/libavcodec/targaenc.c
index d336e00..42dcc66 100644
--- a/libavcodec/targaenc.c
+++ b/libavcodec/targaenc.c
@@ -102,19 +102,19 @@ static int targa_encode_frame(AVCodecContext *avctx,
 
     switch(avctx->pix_fmt) {
     case PIX_FMT_GRAY8:
-        outbuf[2] = 3;           /* uncompressed grayscale image */
+        outbuf[2] = TGA_BW;      /* uncompressed grayscale image */
         outbuf[16] = 8;          /* bpp */
         break;
     case PIX_FMT_RGB555LE:
-        outbuf[2] = 2;           /* uncompresses true-color image */
+        outbuf[2] = TGA_RGB;     /* uncompresses true-color image */
         outbuf[16] = 16;         /* bpp */
         break;
     case PIX_FMT_BGR24:
-        outbuf[2] = 2;           /* uncompressed true-color image */
+        outbuf[2] = TGA_RGB;     /* uncompressed true-color image */
         outbuf[16] = 24;         /* bpp */
         break;
     case PIX_FMT_BGRA:
-        outbuf[2] = 2;           /* uncompressed true-color image */
+        outbuf[2] = TGA_RGB;     /* uncompressed true-color image */
         outbuf[16] = 32;         /* bpp */
         break;
     default:
-- 
1.7.1




More information about the ffmpeg-devel mailing list