]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/qtrleenc.c
Merge commit 'd338abb664febbc2c7266af7818aab1f12dbc161'
[ffmpeg] / libavcodec / qtrleenc.c
index 5aa7420ae4b71fd652ba34ffe9bb0541d4a53d24..cdd864bf820953cf22e6b389583ee9d95c0829a7 100644 (file)
@@ -363,7 +363,6 @@ static int qtrle_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
                               const AVFrame *pict, int *got_packet)
 {
     QtrleEncContext * const s = avctx->priv_data;
-    enum AVPictureType pict_type;
     int ret;
 
     if ((ret = ff_alloc_packet2(avctx, pkt, s->max_buf_size, 0)) < 0)
@@ -371,11 +370,9 @@ static int qtrle_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 
     if (avctx->gop_size == 0 || (s->avctx->frame_number % avctx->gop_size) == 0) {
         /* I-Frame */
-        pict_type = AV_PICTURE_TYPE_I;
         s->key_frame = 1;
     } else {
         /* P-Frame */
-        pict_type = AV_PICTURE_TYPE_P;
         s->key_frame = 0;
     }
 
@@ -392,7 +389,7 @@ static int qtrle_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 #if FF_API_CODED_FRAME
 FF_DISABLE_DEPRECATION_WARNINGS
     avctx->coded_frame->key_frame = s->key_frame;
-    avctx->coded_frame->pict_type = pict_type;
+    avctx->coded_frame->pict_type = s->key_frame ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
 FF_ENABLE_DEPRECATION_WARNINGS
 #endif