videopool: take pixel stride into account
authorWim Taymans <wim.taymans@collabora.co.uk>
Mon, 28 May 2012 09:08:18 +0000 (11:08 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Mon, 28 May 2012 10:59:40 +0000 (12:59 +0200)
When we need to add borders, take the pixel stride into account to move to the
right horizintal offset.

gst-libs/gst/video/gstvideopool.c

index 485decc..beaf262 100644 (file)
@@ -128,10 +128,11 @@ gst_video_info_align (GstVideoInfo * info, GstVideoAlignment * align)
     vedge = GST_VIDEO_FORMAT_INFO_SCALE_HEIGHT (vinfo, i, align->padding_top);
     plane = GST_VIDEO_FORMAT_INFO_PLANE (vinfo, i);
 
-    GST_DEBUG ("plane %d: hedge %d vedge %d align %d", plane, hedge, vedge,
-        align->stride_align[i]);
+    GST_DEBUG ("plane %d: hedge %d vedge %d align %d stride %d", plane, hedge,
+        vedge, align->stride_align[i], info->stride[plane]);
 
-    info->offset[plane] += (vedge * info->stride[plane]) + hedge;
+    info->offset[plane] += (vedge * info->stride[plane]) +
+        (hedge * GST_VIDEO_FORMAT_INFO_PSTRIDE (vinfo, i));
   }
 }