Mercurial > mplayer.hg
diff vidix/drivers/mga_vid.c @ 13227:45f25ea0c5fa
fix for i420 format, initial patch by Aurelien Jacobs <aurel at gnuage.org> from the Geexbox mplayer patchset, some modification by me
author | faust3 |
---|---|
date | Thu, 02 Sep 2004 11:34:25 +0000 |
parents | 972d1998bde9 |
children | 61cc20df7f3e |
line wrap: on
line diff
--- a/vidix/drivers/mga_vid.c Thu Sep 02 06:57:51 2004 +0000 +++ b/vidix/drivers/mga_vid.c Thu Sep 02 11:34:25 2004 +0000 @@ -775,8 +775,15 @@ config->offsets[i] = i*config->frame_size; config->offset.y=0; - config->offset.v=((sw + 31) & ~31) * sh; - config->offset.u=config->offset.v+((sw + 31) & ~31) * sh /4; + if(config->fourcc == IMGFMT_I420 || config->fourcc == IMGFMT_IYUV) + { + config->offset.u=((sw + 31) & ~31) * sh; + config->offset.v=config->offset.u+((sw + 31) & ~31) * sh /4; + } + else { + config->offset.v=((sw + 31) & ~31) * sh; + config->offset.u=config->offset.v+((sw + 31) & ~31) * sh /4; + } //FIXME figure out a better way to allocate memory on card //allocate 2 megs