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

@@ -210,9 +210,8 @@ static int cmv_decode_frame(AVCodecContext *avctx, AVFrame *frame,
cmv_decode_intra(s, frame, buf+2, buf_end);
}
av_frame_unref(s->last2_frame);
av_frame_move_ref(s->last2_frame, s->last_frame);
if ((ret = av_frame_ref(s->last_frame, frame)) < 0)
FFSWAP(AVFrame*, s->last2_frame, s->last_frame);
if ((ret = av_frame_replace(s->last_frame, frame)) < 0)
return ret;
*got_frame = 1;