aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/avfiltergraph.c
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2025-07-06 10:14:34 +0200
committerMarton Balint <cus@passwd.hu>2025-07-14 22:05:10 +0200
commitb24155cae11cd13987b3ca286fd4be1df33807fc (patch)
tree63284861dc3d26ac9257da2d24e655cafd56f566 /libavfilter/avfiltergraph.c
parent71468e85ae720cb63aa9689f0d94e9e9689b9de9 (diff)
downloadffmpeg-b24155cae11cd13987b3ca286fd4be1df33807fc.tar.gz
avfilter/avfilter: add AVFilterGraph->max_buffered_frames to limit buffered frames
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavfilter/avfiltergraph.c')
-rw-r--r--libavfilter/avfiltergraph.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
index 38b89db22a..86da0b9975 100644
--- a/libavfilter/avfiltergraph.c
+++ b/libavfilter/avfiltergraph.c
@@ -56,6 +56,8 @@ static const AVOption filtergraph_options[] = {
AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, F|V },
{"aresample_swr_opts" , "default aresample filter options" , OFFSET(aresample_swr_opts) ,
AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, F|A },
+ {"max_buffered_frames" , "maximum number of buffered frames allowed", OFFSET(max_buffered_frames),
+ AV_OPT_TYPE_UINT, {.i64 = 0}, 0, UINT_MAX, F|V|A },
{ NULL },
};
@@ -1296,6 +1298,8 @@ int avfilter_graph_config(AVFilterGraph *graphctx, void *log_ctx)
{
int ret;
+ if (graphctx->max_buffered_frames)
+ fffiltergraph(graphctx)->frame_queues.max_queued = graphctx->max_buffered_frames;
if ((ret = graph_check_validity(graphctx, log_ctx)))
return ret;
if ((ret = graph_config_formats(graphctx, log_ctx)))