From dcf556893fa7b9a2a0939b3c88dc478e0a1ce92e Mon Sep 17 00:00:00 2001 From: David Schleef Date: Wed, 28 Oct 2009 22:10:33 -0700 Subject: [PATCH] theora: Fix alignment of frames when converting Fix logic inversion in calculating the offset in the theora frame when copying to a GStreamer frame. --- ext/theora/theoradec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/theora/theoradec.c b/ext/theora/theoradec.c index 655452003e..5a4a98dcba 100644 --- a/ext/theora/theoradec.c +++ b/ext/theora/theoradec.c @@ -1174,9 +1174,9 @@ theora_handle_image (GstTheoraDec * dec, th_ycbcr_buffer buf, GstBuffer ** out) GST_BUFFER_DATA (*out) + gst_video_format_get_component_offset (format, plane, dec->width, dec->height); src = buf[plane].data; - src += ((height < dec->height) ? dec->offset_y : dec->offset_y / 2) + src += ((height == dec->height) ? dec->offset_y : dec->offset_y / 2) * buf[plane].stride; - src += (width < dec->width) ? dec->offset_x : dec->offset_x / 2; + src += (width == dec->width) ? dec->offset_x : dec->offset_x / 2; for (i = 0; i < height; i++) { memcpy (dest, src, width);