[FFmpeg-cvslog] r20120 - trunk/libavcodec/targaenc.c

benoit subversion
Thu Oct 1 14:20:08 CEST 2009


Author: benoit
Date: Thu Oct  1 14:20:08 2009
New Revision: 20120

Log:
Add support for TARGA images without RLE compression.
Patch by Anne-Laure de Smit: gmail_address(annelaure, desmit)

Modified:
   trunk/libavcodec/targaenc.c

Modified: trunk/libavcodec/targaenc.c
==============================================================================
--- trunk/libavcodec/targaenc.c	Thu Oct  1 13:58:34 2009	(r20119)
+++ trunk/libavcodec/targaenc.c	Thu Oct  1 14:20:08 2009	(r20120)
@@ -76,7 +76,7 @@ static int targa_encode_frame(AVCodecCon
                               unsigned char *outbuf,
                               int buf_size, void *data){
     AVFrame *p = data;
-    int bpp, picsize, datasize;
+    int bpp, picsize, datasize = -1;
     uint8_t *out;
 
     if(avctx->width > 0xffff || avctx->height > 0xffff) {
@@ -120,6 +120,7 @@ static int targa_encode_frame(AVCodecCon
     out = outbuf + 18;  /* skip past the header we just output */
 
     /* try RLE compression */
+    if (avctx->coder_type != FF_CODER_TYPE_RAW)
     datasize = targa_encode_rle(out, picsize, p, bpp, avctx->width, avctx->height);
 
     /* if that worked well, mark the picture as RLE compressed */



More information about the ffmpeg-cvslog mailing list