1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-11 17:39:38 +00:00

round up width/height if mod 2 != 0

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5008 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi 2002-03-09 21:53:03 +00:00
parent 8ed9dad99c
commit c8f10dc2a8

View File

@ -210,17 +210,22 @@ static uint32_t config( uint32_t width, uint32_t height, uint32_t d_width, uint3
return(-1);
}
width+=width&1;
switch(format)
{
case IMGFMT_YV12:
height+=height&1;
mga_vid_config.format=MGA_VID_FORMAT_YV12;
mga_vid_config.frame_size=( ( width + 31 ) & ~31 ) * height + ( ( ( width + 31 ) & ~31 ) * height ) / 2;
break;
case IMGFMT_I420:
height+=height&1;
mga_vid_config.format=MGA_VID_FORMAT_I420;
mga_vid_config.frame_size=( ( width + 31 ) & ~31 ) * height + ( ( ( width + 31 ) & ~31 ) * height ) / 2;
break;
case IMGFMT_IYUV:
height+=height&1;
mga_vid_config.format=MGA_VID_FORMAT_IYUV;
mga_vid_config.frame_size=( ( width + 31 ) & ~31 ) * height + ( ( ( width + 31 ) & ~31 ) * height ) / 2;
break;