From 50c491dd36e799cd7205de54ff0a1ee80559ebde Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Sun, 1 Mar 2015 09:43:32 -0500 Subject: [PATCH] glbufferpool: Fix offset for odd height We also need to recalculate the offset, since otherwise the frame mapping will be forward two lines in the U and V planes (I420) due to gst_video_info_align() round up the Y plane to a even number of lines. https://bugzilla.gnome.org/show_bug.cgi?id=745054 --- gst-libs/gst/gl/gstglbufferpool.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/gl/gstglbufferpool.c b/gst-libs/gst/gl/gstglbufferpool.c index 6cb2957137..6dd496ca1f 100644 --- a/gst-libs/gst/gl/gstglbufferpool.c +++ b/gst-libs/gst/gl/gstglbufferpool.c @@ -172,9 +172,10 @@ gst_gl_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config) glpool->upload = gst_gl_upload_meta_new (glpool->context); } - /* Recalulate the size as we don't add padding between planes. */ + /* Recalulate the size and offset as we don't add padding between planes. */ priv->info.size = 0; for (p = 0; p < GST_VIDEO_INFO_N_PLANES (&priv->info); p++) { + priv->info.offset[p] = priv->info.size; priv->info.size += gst_gl_get_plane_data_size (&priv->info, &priv->valign, p); }