X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fmpegvideo_enc.c;h=f837b3f29d9664c951d4e871cb5c5cf62de78152;hb=27e61a716c893a6ae67ca8f859c735bc0b0b799a;hp=71ea9faba6eaa6d31ae3bb80317c2bec46783ad9;hpb=c0894e62881480f2fdedc95a41101f1add03d419;p=ffmpeg diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 71ea9faba6e..f837b3f29d9 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -857,8 +857,6 @@ FF_ENABLE_DEPRECATION_WARNINGS ff_pixblockdsp_init(&s->pdsp, avctx); ff_qpeldsp_init(&s->qdsp); - s->avctx->coded_frame = s->current_picture.f; - if (s->msmpeg4_version) { FF_ALLOCZ_OR_GOTO(s->avctx, s->ac_stats, 2 * 2 * (MAX_LEVEL + 1) * @@ -1619,8 +1617,11 @@ static void frame_end(MpegEncContext *s) if (s->pict_type!= AV_PICTURE_TYPE_B) s->last_non_b_pict_type = s->pict_type; - s->avctx->coded_frame = s->current_picture_ptr->f; - +#if FF_API_CODED_FRAME +FF_DISABLE_DEPRECATION_WARNINGS + av_frame_copy_props(s->avctx->coded_frame, s->current_picture.f); +FF_ENABLE_DEPRECATION_WARNINGS +#endif } static void update_noise_reduction(MpegEncContext *s) @@ -1784,6 +1785,8 @@ vbv_retry: frame_end(s); + ff_side_data_set_encoder_stats(pkt, s->current_picture.f->quality, NULL, 0, s->pict_type); + if (CONFIG_MJPEG_ENCODER && s->out_format == FMT_MJPEG) ff_mjpeg_encode_picture_trailer(&s->pb, s->header_bits);