[FFmpeg-devel] [PATCH] lavfi/vflip: remove get_video_buffer.

Clément Bœsch ubitux at gmail.com
Wed Apr 17 15:17:52 CEST 2013


Code is duplicated with filter_frame for no reason. Fixes a crash with
-f lavfi testsrc,vflip.
---
 libavfilter/vf_vflip.c | 23 -----------------------
 1 file changed, 23 deletions(-)

diff --git a/libavfilter/vf_vflip.c b/libavfilter/vf_vflip.c
index 28fa800..9a70474 100644
--- a/libavfilter/vf_vflip.c
+++ b/libavfilter/vf_vflip.c
@@ -43,28 +43,6 @@ static int config_input(AVFilterLink *link)
     return 0;
 }
 
-static AVFrame *get_video_buffer(AVFilterLink *link, int w, int h)
-{
-    FlipContext *flip = link->dst->priv;
-    AVFrame *frame;
-    int i;
-
-    frame = ff_get_video_buffer(link->dst->outputs[0], w, h);
-    if (!frame)
-        return NULL;
-
-    for (i = 0; i < 4; i ++) {
-        int vsub = i == 1 || i == 2 ? flip->vsub : 0;
-
-        if (frame->data[i]) {
-            frame->data[i] += (((h + (1<<vsub) - 1) >> vsub) - 1) * frame->linesize[i];
-            frame->linesize[i] = -frame->linesize[i];
-        }
-    }
-
-    return frame;
-}
-
 static int filter_frame(AVFilterLink *link, AVFrame *frame)
 {
     FlipContext *flip = link->dst->priv;
@@ -85,7 +63,6 @@ static const AVFilterPad avfilter_vf_vflip_inputs[] = {
     {
         .name             = "default",
         .type             = AVMEDIA_TYPE_VIDEO,
-        .get_video_buffer = get_video_buffer,
         .filter_frame     = filter_frame,
         .config_props     = config_input,
     },
-- 
1.8.2.1



More information about the ffmpeg-devel mailing list