mirror of
https://github.com/librempeg/librempeg
synced 2024-11-22 09:02:20 +00:00
lavfi/framesync: avoid forcing frame writability unnecessarily
Callers of ff_framesync_get_frame() generally do not expect the result to be writable, those that do (e.g. ff_framesync_dualinput_get_writable()) ensure writability themselves. Significantly reduces memory consumption in complex graphs with framesync-based filters (e.g. scale, ssim). Reported-By: Mark Shwartzman Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
parent
5f30822782
commit
b272c2840b
@ -272,7 +272,6 @@ int ff_framesync_get_frame(FFFrameSync *fs, unsigned in, AVFrame **rframe,
|
||||
AVFrame *frame;
|
||||
unsigned need_copy = 0, i;
|
||||
int64_t pts_next;
|
||||
int ret;
|
||||
|
||||
if (!fs->in[in].frame) {
|
||||
*rframe = NULL;
|
||||
@ -290,10 +289,6 @@ int ff_framesync_get_frame(FFFrameSync *fs, unsigned in, AVFrame **rframe,
|
||||
if (need_copy) {
|
||||
if (!(frame = av_frame_clone(frame)))
|
||||
return AVERROR(ENOMEM);
|
||||
if ((ret = ff_inlink_make_frame_writable(fs->parent->inputs[in], &frame)) < 0) {
|
||||
av_frame_free(&frame);
|
||||
return ret;
|
||||
}
|
||||
} else {
|
||||
fs->in[in].frame = NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user