summaryrefslogtreecommitdiff
path: root/libavcodec/targaenc.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-02-19 10:44:52 +0100
committerAnton Khirnov <anton@khirnov.net>2012-02-20 07:50:44 +0100
commit1e742ea3c8c284cedad7171cafdc9a9c8f3108d7 (patch)
tree5fff3c00c5941ef65a3ebbf0a7b4c35dcb4f0e55 /libavcodec/targaenc.c
parent3227770092c8beb73582d2df08c3e32055b283d5 (diff)
targaenc: don't modify input frame.
Set the pict_type/key_frame properties on the coded picture.
Diffstat (limited to 'libavcodec/targaenc.c')
-rw-r--r--libavcodec/targaenc.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/libavcodec/targaenc.c b/libavcodec/targaenc.c
index 276bcc83eb..1d857e53e0 100644
--- a/libavcodec/targaenc.c
+++ b/libavcodec/targaenc.c
@@ -91,9 +91,6 @@ static int targa_encode_frame(AVCodecContext *avctx,
return AVERROR(EINVAL);
}
- p->pict_type= AV_PICTURE_TYPE_I;
- p->key_frame= 1;
-
/* zero out the header and only set applicable fields */
memset(outbuf, 0, 12);
AV_WL16(outbuf+12, avctx->width);
@@ -154,6 +151,7 @@ static av_cold int targa_encode_init(AVCodecContext *avctx)
avcodec_get_frame_defaults(&s->picture);
s->picture.key_frame= 1;
+ s->picture.pict_type = AV_PICTURE_TYPE_I;
avctx->coded_frame= &s->picture;
return 0;