ffmpeg | branch: master | Marton Balint <c...@passwd.hu> | Sun Jun 22 20:48:09 
2025 +0200| [44546751db824002f07cc0b8b2fc62587a5a34b5] | committer: Marton 
Balint

avfilter/avfilter: make filter_activate_default request frames on behalf of 
sinks

Sinks without an activate callback have no means to request frames in their
input, therefore the default activate callback should do it for them.

Fixes ticket #11624.
Fixes ticket #10988.
Fixes ticket #10990.

Signed-off-by: Marton Balint <c...@passwd.hu>

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

 libavfilter/avfilter.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index e03dc65fc6..5bcf0b4ef7 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -1288,6 +1288,10 @@ static int filter_activate_default(AVFilterContext 
*filter)
         if (li->frame_wanted_out)
             return request_frame_to_filter(filter->outputs[i]);
     }
+    if (!filter->nb_outputs) {
+        ff_inlink_request_frame(filter->inputs[0]);
+        return 0;
+    }
     return FFERROR_NOT_READY;
 }
 
@@ -1427,6 +1431,11 @@ static int filter_activate_default(AVFilterContext 
*filter)
      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.
+
+   - Request a frame on the input for sinks.
+
+     Rationale: sinks using the old api have no way to request a frame on their
+     input, so we need to do it for them.
  */
 
 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