[FFmpeg-devel] [PATCH 1/2] lavfi/video: ensure that filter_frame is called.

Nicolas George nicolas.george at normalesup.org
Sun Dec 30 11:18:04 CET 2012


This is a temporary workaround until all filters have been
upgraded to filter_frame and the framework can forget completely
about start_frame/draw_slice/end_frame.

Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
---
 libavfilter/video.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)


Slightly more correct version than the previous one.
Passes FATE alone or with 2/2, and succeeds even without 4cd724d.

With this pair of patch, it is probably possible to finish merging
the filter_frame code.


diff --git a/libavfilter/video.c b/libavfilter/video.c
index e619db1..c5f8706 100644
--- a/libavfilter/video.c
+++ b/libavfilter/video.c
@@ -163,6 +163,9 @@ static int default_start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
 {
     AVFilterLink *outlink = NULL;
 
+    if (inlink->dstpad->filter_frame)
+        return 0;
+
     if (inlink->dst->nb_outputs)
         outlink = inlink->dst->outputs[0];
 
@@ -275,6 +278,12 @@ static int default_end_frame(AVFilterLink *inlink)
 {
     AVFilterLink *outlink = NULL;
 
+    if (inlink->dstpad->filter_frame) {
+        int ret = inlink->dstpad->filter_frame(inlink, inlink->cur_buf);
+        inlink->cur_buf = NULL;
+        return ret;
+    }
+
     if (inlink->dst->nb_outputs)
         outlink = inlink->dst->outputs[0];
 
@@ -313,6 +322,9 @@ static int default_draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
 {
     AVFilterLink *outlink = NULL;
 
+    if (inlink->dstpad->filter_frame)
+        return 0;
+
     if (inlink->dst->nb_outputs)
         outlink = inlink->dst->outputs[0];
 
-- 
1.7.10.4



More information about the ffmpeg-devel mailing list