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

@@ -819,8 +819,7 @@ int av_hwframe_map(AVFrame *dst, const AVFrame *src, int flags)
return AVERROR(EINVAL);
}
hwmap = (HWMapDescriptor*)src->buf[0]->data;
av_frame_unref(dst);
return av_frame_ref(dst, hwmap->source);
return av_frame_replace(dst, hwmap->source);
}
}
@@ -950,6 +949,5 @@ fail:
int ff_hwframe_map_replace(AVFrame *dst, const AVFrame *src)
{
HWMapDescriptor *hwmap = (HWMapDescriptor*)dst->buf[0]->data;
av_frame_unref(hwmap->source);
return av_frame_ref(hwmap->source, src);
return av_frame_replace(hwmap->source, src);
}