]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/qtrleenc.c
Merge commit 'd75b55635a02444c2f188c26e431a1cec992babe'
[ffmpeg] / libavcodec / qtrleenc.c
index bf68d7f24219da71dbcf5b156c8a64314ad009c4..590c39dceab52c791a30392ee0454af38abad5c7 100644 (file)
@@ -67,8 +67,6 @@ static av_cold int qtrle_encode_end(AVCodecContext *avctx)
 {
     QtrleEncContext *s = avctx->priv_data;
 
-    av_frame_free(&avctx->coded_frame);
-
     avpicture_free(&s->previous_frame);
     av_free(s->rlecode_table);
     av_free(s->length_table);
@@ -128,12 +126,6 @@ static av_cold int qtrle_encode_init(AVCodecContext *avctx)
                       + s->avctx->height*2                            /* skip code+rle end */
                       + s->logical_width/MAX_RLE_BULK + 1             /* rle codes */;
 
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame) {
-        qtrle_encode_end(avctx);
-        return AVERROR(ENOMEM);
-    }
-
     return 0;
 }
 
@@ -374,7 +366,7 @@ static int qtrle_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     enum AVPictureType pict_type;
     int ret;
 
-    if ((ret = ff_alloc_packet2(avctx, pkt, s->max_buf_size)) < 0)
+    if ((ret = ff_alloc_packet2(avctx, pkt, s->max_buf_size, 0)) < 0)
         return ret;
 
     if (avctx->gop_size == 0 || (s->avctx->frame_number % avctx->gop_size) == 0) {
@@ -393,8 +385,12 @@ static int qtrle_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     av_picture_copy(&s->previous_frame, (const AVPicture *)pict,
                     avctx->pix_fmt, avctx->width, avctx->height);
 
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
     avctx->coded_frame->key_frame = s->key_frame;
     avctx->coded_frame->pict_type = pict_type;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
 
     if (s->key_frame)
         pkt->flags |= AV_PKT_FLAG_KEY;