X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fqtrleenc.c;h=590c39dceab52c791a30392ee0454af38abad5c7;hb=77c3908d5cd076d343554d0f73360a00b5fc90ab;hp=bf68d7f24219da71dbcf5b156c8a64314ad009c4;hpb=439c9760b046caaffceacc08c40692f2e8cb3f03;p=ffmpeg diff --git a/libavcodec/qtrleenc.c b/libavcodec/qtrleenc.c index bf68d7f2421..590c39dceab 100644 --- a/libavcodec/qtrleenc.c +++ b/libavcodec/qtrleenc.c @@ -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;