From a974a54486c865b4482139ec55df8a04861ae9e3 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Mon, 4 May 2026 13:26:51 +0200 Subject: [PATCH] avfilter: add less confusing error on frame queue overflow Currently, such filter graphs just fail with a nebulous: [fc#0 @ 0x2a7b3c0] [error] Error while filtering: Cannot allocate memory Sponsored-by: nxtedition AB Signed-off-by: Niklas Haas --- libavfilter/avfilter.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index b15f0b08b4..0d46d303de 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -1109,6 +1109,9 @@ int ff_filter_frame(AVFilterLink *link, AVFrame *frame) filter_unblock(link->dst); ret = ff_framequeue_add(&li->fifo, frame); if (ret < 0) { + const FFFrameQueueGlobal *global = li->fifo.global; + if (ret == AVERROR(ENOMEM) && global->queued >= global->max_queued) + av_log(link->dst, AV_LOG_ERROR, "Exhausted frame queue capacity (%zu frames)\n", global->max_queued); av_frame_free(&frame); return ret; }