aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2024-07-24 17:10:41 +0200
committerAnton Khirnov <anton@khirnov.net>2024-07-31 11:12:45 +0200
commit43f702a2532c7ddd84160a0a46ed36ad6f4b7c0a (patch)
treed48dffc3c84949911f02ed052b6845edf847bbd8
parent262168b04e6807fce6a78507c14cfc166ba72845 (diff)
downloadffmpeg-43f702a2532c7ddd84160a0a46ed36ad6f4b7c0a.tar.gz
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
-rw-r--r--libavfilter/framesync.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/libavfilter/framesync.c b/libavfilter/framesync.c
index 535fbe9c7c..8e06e0e700 100644
--- a/libavfilter/framesync.c
+++ b/libavfilter/framesync.c
@@ -273,7 +273,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;
@@ -291,10 +290,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;
}