1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Fix round to even for aspect ratio correction.

Originally committed as revision 15173 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2008-09-03 11:16:29 +00:00
parent 0ad306bc81
commit bb6c34e55b

View File

@ -731,10 +731,10 @@ static void video_image_display(VideoState *is)
/* XXX: we suppose the screen has a 1.0 pixel ratio */
height = is->height;
width = ((int)rint(height * aspect_ratio)) & -3;
width = ((int)rint(height * aspect_ratio)) & ~1;
if (width > is->width) {
width = is->width;
height = ((int)rint(width / aspect_ratio)) & -3;
height = ((int)rint(width / aspect_ratio)) & ~1;
}
x = (is->width - width) / 2;
y = (is->height - height) / 2;