mirror of https://git.ffmpeg.org/ffmpeg.git
avfilter/buffersrc: Use av_frame_clone() where appropriate
Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
185d0acdc7
commit
67cc7aaa51
|
@ -230,17 +230,14 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (refcounted && !(flags & AV_BUFFERSRC_FLAG_KEEP_REF)) {
|
||||||
if (!(copy = av_frame_alloc()))
|
if (!(copy = av_frame_alloc()))
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
|
||||||
if (refcounted && !(flags & AV_BUFFERSRC_FLAG_KEEP_REF)) {
|
|
||||||
av_frame_move_ref(copy, frame);
|
av_frame_move_ref(copy, frame);
|
||||||
} else {
|
} else {
|
||||||
ret = av_frame_ref(copy, frame);
|
copy = av_frame_clone(frame);
|
||||||
if (ret < 0) {
|
if (!copy)
|
||||||
av_frame_free(©);
|
return AVERROR(ENOMEM);
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if FF_API_PKT_DURATION
|
#if FF_API_PKT_DURATION
|
||||||
|
|
Loading…
Reference in New Issue