summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeiko Schaefer <heikos@users.sourceforge.net>2002-06-04 08:36:52 +0000
committerHeiko Schaefer <heikos@users.sourceforge.net>2002-06-04 08:36:52 +0000
commit121e59d7db81a58e04b2a09d22a7e132a957d0a2 (patch)
tree99210dd22f41e90aee2c2e950cc0b228d853f4cd
parent0d7a0df05f5f13f27c676d37051c48d375a6d6f6 (diff)
downloadxine-lib-121e59d7db81a58e04b2a09d22a7e132a957d0a2.tar.gz
xine-lib-121e59d7db81a58e04b2a09d22a7e132a957d0a2.tar.bz2
fixed output (bad colors) for a video stream with odd height (not a
multiple of 4). tested for this one stream which was decoded by ffmpeg. this could possibly break other streams with strange height. CVS patchset: 2011 CVS date: 2002/06/04 08:36:52
-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;