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

Nicolas George nicolas.george at normalesup.org
Thu Dec 27 00:44:49 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(+)

diff --git a/libavfilter/video.c b/libavfilter/video.c
index e619db1..a9d528c 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) {
+        AVFilterBufferRef *cur_buf = inlink->cur_buf;
+        inlink->cur_buf = NULL;
+        return inlink->dstpad->filter_frame(inlink, cur_buf);
+    }
+
     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