all: Use av_frame_replace() where appropriate

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2023-09-07 12:02:26 +02:00
parent 0487786ffe
commit cfa47fd331
31 changed files with 34 additions and 67 deletions

View file

@ -93,8 +93,7 @@ static int zerocodec_decode_frame(AVCodecContext *avctx, AVFrame *pic,
dst -= pic->linesize[0];
}
av_frame_unref(zc->previous_frame);
if ((ret = av_frame_ref(zc->previous_frame, pic)) < 0)
if ((ret = av_frame_replace(zc->previous_frame, pic)) < 0)
return ret;
*got_frame = 1;