ffmpeg | branch: master | Marton Balint <c...@passwd.hu> | Sun Jun 22 15:39:29 
2025 +0200| [4440e499bae0235a8f4f4308c45be8f70f29ff2d] | committer: Marton 
Balint

avfilter/avfilter: always forward request frame in filter_activate_default

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 <c...@passwd.hu>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4440e499bae0235a8f4f4308c45be8f70f29ff2d
---

 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)

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

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

Reply via email to