Add support for TARGA images without RLE compression.
Patch by Anne-Laure de Smit: gmail_address(annelaure, desmit) Originally committed as revision 20120 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
07f77dad7a
commit
e23dd95dc2
@ -76,7 +76,7 @@ static int targa_encode_frame(AVCodecContext *avctx,
|
|||||||
unsigned char *outbuf,
|
unsigned char *outbuf,
|
||||||
int buf_size, void *data){
|
int buf_size, void *data){
|
||||||
AVFrame *p = data;
|
AVFrame *p = data;
|
||||||
int bpp, picsize, datasize;
|
int bpp, picsize, datasize = -1;
|
||||||
uint8_t *out;
|
uint8_t *out;
|
||||||
|
|
||||||
if(avctx->width > 0xffff || avctx->height > 0xffff) {
|
if(avctx->width > 0xffff || avctx->height > 0xffff) {
|
||||||
@ -120,6 +120,7 @@ static int targa_encode_frame(AVCodecContext *avctx,
|
|||||||
out = outbuf + 18; /* skip past the header we just output */
|
out = outbuf + 18; /* skip past the header we just output */
|
||||||
|
|
||||||
/* try RLE compression */
|
/* try RLE compression */
|
||||||
|
if (avctx->coder_type != FF_CODER_TYPE_RAW)
|
||||||
datasize = targa_encode_rle(out, picsize, p, bpp, avctx->width, avctx->height);
|
datasize = targa_encode_rle(out, picsize, p, bpp, avctx->width, avctx->height);
|
||||||
|
|
||||||
/* if that worked well, mark the picture as RLE compressed */
|
/* if that worked well, mark the picture as RLE compressed */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user