[FFmpeg-cvslog] libavfilter: default to filter_frame when neither it nor start/slice/ end is set.

Michael Niedermayer git at videolan.org
Thu Nov 29 02:16:07 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Nov 29 02:03:20 2012 +0100| [015c2b40666294bf27ac0f176d66bea0be937231] | committer: Michael Niedermayer

libavfilter: default to filter_frame when neither it nor start/slice/end is set.

this is needed for vf_null and a few others.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavfilter/video.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/libavfilter/video.c b/libavfilter/video.c
index 5eb37e6..46c4190 100644
--- a/libavfilter/video.c
+++ b/libavfilter/video.c
@@ -210,7 +210,7 @@ static int default_start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
     if (inlink->dst->nb_outputs)
         outlink = inlink->dst->outputs[0];
 
-    if (outlink && !inlink->dstpad->filter_frame) {
+    if (outlink && (inlink->dstpad->start_frame || inlink->dstpad->end_frame || inlink->dstpad->draw_slice)) {
         AVFilterBufferRef *buf_out;
         outlink->out_buf = ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
         if (!outlink->out_buf)
@@ -332,8 +332,12 @@ static int default_end_frame(AVFilterLink *inlink)
             int ret = inlink->dstpad->filter_frame(inlink, inlink->cur_buf);
             inlink->cur_buf = NULL;
             return ret;
-        } else {
+        } else if (inlink->dstpad->start_frame || inlink->dstpad->end_frame || inlink->dstpad->draw_slice){
             return ff_end_frame(outlink);
+        } else {
+            int ret = ff_filter_frame(outlink, inlink->cur_buf);
+            inlink->cur_buf = NULL;
+            return ret;
         }
     }
     return 0;
@@ -366,7 +370,7 @@ static int default_draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
     if (inlink->dst->nb_outputs)
         outlink = inlink->dst->outputs[0];
 
-    if (outlink && !inlink->dstpad->filter_frame)
+    if (outlink && (inlink->dstpad->start_frame || inlink->dstpad->end_frame || inlink->dstpad->draw_slice))
         return ff_draw_slice(outlink, y, h, slice_dir);
     return 0;
 }



More information about the ffmpeg-cvslog mailing list