# HG changeset patch # User pacman # Date 1141502406 0 # Node ID fe2520f6039e79f8ab170be5d8fa7e10b21867f9 # Parent 096cb1dfb591b3bf40d47464bab3f955a39d19ca When centering a video with odd width, be sure to start on a pixel boundary. diff -r 096cb1dfb591 -r fe2520f6039e libvo/vo_fbdev.c --- 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); diff -r 096cb1dfb591 -r fe2520f6039e libvo/vo_fbdev2.c --- 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))) {