diff options
author | rfelker <rfelker@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-05-03 19:45:43 +0000 |
---|---|---|
committer | rfelker <rfelker@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-05-03 19:45:43 +0000 |
commit | 4bdb6dbc366b3a1ba43f098adfdf9577e2cbeddd (patch) | |
tree | 56c1a38f807920ae1362b9b7a94cb4bb0c073043 /libmpcodecs | |
parent | 64cab0e9b9e7168229e976c435411a633d18b7d2 (diff) |
fixed raw i420/iyuv to some extent, so that cb/cr channels are no
longer reversed. this should make it possible for bttv users to
play/record video (-tv outfmt=i420) once again without bogus colors.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5954 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r-- | libmpcodecs/vd_raw.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libmpcodecs/vd_raw.c b/libmpcodecs/vd_raw.c index 28461d456b..b218dcc11f 100644 --- a/libmpcodecs/vd_raw.c +++ b/libmpcodecs/vd_raw.c @@ -65,10 +65,14 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ mpi->stride[0]=mpi->width; if(mpi->bpp == 12 && mpi->flags&MP_IMGFLAG_YUV) { // Support for some common Planar YUV formats - mpi->planes[2]=data+mpi->width*mpi->height; - mpi->stride[2]=mpi->width/2; - mpi->planes[1]=data+5*mpi->width*mpi->height/4; - mpi->stride[1]=mpi->width/2; + int cb=2, cr=1; + if (sh->format == IMGFMT_IYUV || sh->format == IMGFMT_I420) { + cb=1; cr=2; + } + mpi->planes[cb]=data+mpi->width*mpi->height; + mpi->stride[cb]=mpi->width/2; + mpi->planes[cr]=data+5*mpi->width*mpi->height/4; + mpi->stride[cr]=mpi->width/2; } } else { mpi->planes[0]=data; |