[FFmpeg-soc] [soc]: r5626 - libavfilter/vf_pad.c

stefano subversion at mplayerhq.hu
Sun Feb 21 01:14:39 CET 2010


Author: stefano
Date: Sun Feb 21 01:14:39 2010
New Revision: 5626

Log:
10l: move the pad->w initialization/normalization before filling
pas->line with color, as when the latter is done the effective pad->w
is used.

Fix the case when the user provide a value of 0 for the pad width.

Thanks to Jarred Nicholls <$name.$surname at gmail.com> for helping me to
figure this out.

Modified:
   libavfilter/vf_pad.c

Modified: libavfilter/vf_pad.c
==============================================================================
--- libavfilter/vf_pad.c	Fri Feb 19 01:00:18 2010	(r5625)
+++ libavfilter/vf_pad.c	Sun Feb 21 01:14:39 2010	(r5626)
@@ -125,6 +125,19 @@ static int config_input(AVFilterLink *in
     pad->hsub = pix_desc->log2_chroma_w;
     pad->vsub = pix_desc->log2_chroma_h;
 
+    if (!pad->w)
+        pad->w = inlink->w;
+    if (!pad->h)
+        pad->h = inlink->h;
+
+    pad->w &= ~((1 << pad->hsub) - 1);
+    pad->h &= ~((1 << pad->vsub) - 1);
+    pad->x &= ~((1 << pad->hsub) - 1);
+    pad->y &= ~((1 << pad->vsub) - 1);
+
+    pad->in_w = inlink->w & ~((1 << pad->hsub) - 1);
+    pad->in_h = inlink->h & ~((1 << pad->vsub) - 1);
+
     memcpy(rgba_color, pad->color, sizeof(rgba_color));
     if (is_packed_rgb) {
         pad->line_step[0] = (av_get_bits_per_pixel(&av_pix_fmt_descriptors[inlink->format]))>>3;
@@ -153,19 +166,6 @@ static int config_input(AVFilterLink *in
         }
     }
 
-    if (!pad->w)
-        pad->w = inlink->w;
-    if (!pad->h)
-        pad->h = inlink->h;
-
-    pad->w &= ~((1 << pad->hsub) - 1);
-    pad->h &= ~((1 << pad->vsub) - 1);
-    pad->x &= ~((1 << pad->hsub) - 1);
-    pad->y &= ~((1 << pad->vsub) - 1);
-
-    pad->in_w = inlink->w & ~((1 << pad->hsub) - 1);
-    pad->in_h = inlink->h & ~((1 << pad->vsub) - 1);
-
     av_log(ctx, AV_LOG_INFO, "w:%d h:%d x:%d y:%d color:0x%02X%02X%02X%02X[%s]\n",
            pad->w, pad->h, pad->x, pad->y,
            pad->color[0], pad->color[1], pad->color[2], pad->color[3],


More information about the FFmpeg-soc mailing list