From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ffmpeg-devel-bounces@ffmpeg.org>
Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100])
	by master.gitmailbox.com (Postfix) with ESMTPS id 9442C4FA35
	for <ffmpegdev@gitmailbox.com>; Tue, 24 Jun 2025 19:24:23 +0000 (UTC)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 2260F68D2E2;
	Tue, 24 Jun 2025 22:23:45 +0300 (EEST)
Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140])
 by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 17D4A68CFDC
 for <ffmpeg-devel@ffmpeg.org>; Tue, 24 Jun 2025 22:23:39 +0300 (EEST)
Received: from localhost (localhost [127.0.0.1])
 by iq.passwd.hu (Postfix) with ESMTP id D7768E9EF1;
 Tue, 24 Jun 2025 21:20:51 +0200 (CEST)
X-Virus-Scanned: amavisd-new at passwd.hu
Received: from iq.passwd.hu ([127.0.0.1])
 by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id hSvFFBKj8vcu; Tue, 24 Jun 2025 21:20:50 +0200 (CEST)
Received: from bluegene.passwd.hu (localhost [127.0.0.1])
 by iq.passwd.hu (Postfix) with ESMTP id 6B29EE9E73;
 Tue, 24 Jun 2025 21:20:50 +0200 (CEST)
From: Marton Balint <cus@passwd.hu>
To: ffmpeg-devel@ffmpeg.org
Date: Tue, 24 Jun 2025 21:23:03 +0200
Message-ID: <20250624192318.7430-5-cus@passwd.hu>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20250624192318.7430-1-cus@passwd.hu>
References: <20250624192318.7430-1-cus@passwd.hu>
MIME-Version: 1.0
Subject: [FFmpeg-devel] [PATCH 05/12] avfilter/avfilter: always forward
 request frame in filter_activate_default
X-BeenThere: ffmpeg-devel@ffmpeg.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org>
List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe>
List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel>
List-Post: <mailto:ffmpeg-devel@ffmpeg.org>
List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help>
List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe>
Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: Marton Balint <cus@passwd.hu>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: ffmpeg-devel-bounces@ffmpeg.org
Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org>
Archived-At: <https://master.gitmailbox.com/ffmpegdev/20250624192318.7430-5-cus@passwd.hu/>
List-Archive: <https://master.gitmailbox.com/ffmpegdev/>
List-Post: <mailto:ffmpegdev@gitmailbox.com>

Even if all inputs are blocked an activate callback should request a frame on
some if its inputs if a frame is requested on any of its outputs.

Signed-off-by: Marton Balint <cus@passwd.hu>
---
 libavfilter/avfilter.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index dd12533208..e03dc65fc6 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -1283,6 +1283,11 @@ static int filter_activate_default(AVFilterContext *filter)
             return request_frame_to_filter(filter->outputs[i]);
         }
     }
+    for (i = 0; i < filter->nb_outputs; i++) {
+        FilterLinkInternal * const li = ff_link_internal(filter->outputs[i]);
+        if (li->frame_wanted_out)
+            return request_frame_to_filter(filter->outputs[i]);
+    }
     return FFERROR_NOT_READY;
 }
 
@@ -1416,6 +1421,12 @@ static int filter_activate_default(AVFilterContext *filter)
      Rationale: checking frame_blocked_in is necessary to avoid requesting
      repeatedly on a blocked input if another is not blocked (example:
      [buffersrc1][testsrc1][buffersrc2][testsrc2]concat=v=2).
+
+   - If an output has frame_wanted_out > 0 call request_frame().
+
+     Rationale: even if all inputs are blocked an activate callback should
+     request a frame on some if its inputs if a frame is requested on any of
+     its output.
  */
 
 int ff_filter_activate(AVFilterContext *filter)
-- 
2.43.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".