]> git.sesse.net Git - ffmpeg/commitdiff
targaenc: don't modify input frame.
authorAnton Khirnov <anton@khirnov.net>
Sun, 19 Feb 2012 09:44:52 +0000 (10:44 +0100)
committerAnton Khirnov <anton@khirnov.net>
Mon, 20 Feb 2012 06:50:44 +0000 (07:50 +0100)
Set the pict_type/key_frame properties on the coded picture.

libavcodec/targaenc.c

index 276bcc83eb98388404a4e541ecf48ce021074f99..1d857e53e0c879e72044fabdfb78669291b1d224 100644 (file)
@@ -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;