]> git.sesse.net Git - ffmpeg/commitdiff
Fix slicify when the slice_direction is negative, make it send slices
authorStefano Sabatini <stefano.sabatini-lala@poste.it>
Sun, 6 Dec 2009 17:40:41 +0000 (17:40 +0000)
committerStefano Sabatini <stefano.sabatini-lala@poste.it>
Sun, 6 Dec 2009 17:40:41 +0000 (17:40 +0000)
from the bottom to the top one.

Originally committed as revision 20754 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavfilter/vf_slicify.c

index 3aae1c334ebea896de36ea0900552ddb3f2379ec..336f223a7c15897fbc79e9db9ac1991eb92d61e7 100644 (file)
@@ -78,11 +78,19 @@ static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
     SliceContext *slice = link->dst->priv;
     int y2;
 
+    if (slice_dir == 1) {
     for (y2 = y; y2 + slice->h <= y + h; y2 += slice->h)
         avfilter_draw_slice(link->dst->outputs[0], y2, slice->h, slice_dir);
 
     if (y2 < y + h)
         avfilter_draw_slice(link->dst->outputs[0], y2, y + h - y2, slice_dir);
+    } else if (slice_dir == -1) {
+        for (y2 = y + h; y2 - slice->h >= y; y2 -= slice->h)
+            avfilter_draw_slice(link->dst->outputs[0], y2 - slice->h, slice->h, slice_dir);
+
+        if (y2 > y)
+            avfilter_draw_slice(link->dst->outputs[0], y, y2 - y, slice_dir);
+    }
 }
 
 AVFilter avfilter_vf_slicify = {