summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video_out/video_out_xv.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c
index 27ce4c5eb..48eca1bd8 100644
--- a/src/video_out/video_out_xv.c
+++ b/src/video_out/video_out_xv.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: video_out_xv.c,v 1.116 2002/05/19 10:35:18 f1rmb Exp $
+ * $Id: video_out_xv.c,v 1.117 2002/06/04 08:36:52 heikos Exp $
*
* video_out_xv.c, X11 video extension interface for xine
*
@@ -446,6 +446,7 @@ static void xv_update_frame_format (vo_driver_t *this_gen,
if ((frame->width != width)
|| (frame->height != height)
|| (frame->format != format)) {
+ int height_rounded;
/* printf ("video_out_xv: updating frame to %d x %d (ratio=%d, format=%08x)\n",width,height,ratio_code,format); */
@@ -462,9 +463,14 @@ static void xv_update_frame_format (vo_driver_t *this_gen,
frame->image = create_ximage (this, &frame->shminfo, width, height, format);
+ if (height % 4)
+ height_rounded = height + (4 - (height % 4));
+ else
+ height_rounded = height;
+
frame->vo_frame.base[0] = frame->image->data;
- frame->vo_frame.base[1] = frame->image->data + width * height * 5 / 4;
- frame->vo_frame.base[2] = frame->image->data + width * height;
+ frame->vo_frame.base[1] = frame->image->data + width * height_rounded * 5 / 4;
+ frame->vo_frame.base[2] = frame->image->data + width * height_rounded;
frame->width = width;
frame->height = height;