changeset 17728:fe2520f6039e

When centering a video with odd width, be sure to start on a pixel boundary.
author pacman
date Sat, 04 Mar 2006 20:00:06 +0000
parents 096cb1dfb591
children 9c3c78d21643
files libvo/vo_fbdev.c libvo/vo_fbdev2.c
diffstat 2 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_fbdev.c	Sat Mar 04 17:33:56 2006 +0000
+++ b/libvo/vo_fbdev.c	Sat Mar 04 20:00:06 2006 +0000
@@ -1005,8 +1005,9 @@
 		return 1;
 	    }
 
-	    center = frame_buffer + (out_width - in_width) * fb_pixel_size /
-		    2 + ( (out_height - in_height) / 2 ) * fb_line_len +
+	    center = frame_buffer +
+		    ( (out_width - in_width) / 2 ) * fb_pixel_size +
+		    ( (out_height - in_height) / 2 ) * fb_line_len +
 		    x_offset * fb_pixel_size + y_offset * fb_line_len;
 
 	    mp_msg(MSGT_VO, MSGL_DBG2, "frame_buffer @ %p\n", frame_buffer);
--- a/libvo/vo_fbdev2.c	Sat Mar 04 17:33:56 2006 +0000
+++ b/libvo/vo_fbdev2.c	Sat Mar 04 20:00:06 2006 +0000
@@ -280,8 +280,9 @@
 		}
 	}
 
-	center = frame_buffer + (out_width - in_width) * fb_pixel_size /
-		2 + ( (out_height - in_height) / 2 ) * fb_line_len;
+	center = frame_buffer +
+	         ( (out_width - in_width) / 2 ) * fb_pixel_size +
+		 ( (out_height - in_height) / 2 ) * fb_line_len;
 
 #ifndef USE_CONVERT2FB
 	if (!(next_frame = (uint8_t *) realloc(next_frame, in_width * in_height * fb_pixel_size))) {