# HG changeset patch # User rfelker # Date 1020455143 0 # Node ID 1ab2605a9e44f6c776304d750e6ed3a92429c0c3 # Parent a9d61459a74131c57167fea099e1a838b1cefce2 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. diff -r a9d61459a741 -r 1ab2605a9e44 libmpcodecs/vd_raw.c --- a/libmpcodecs/vd_raw.c Fri May 03 19:27:34 2002 +0000 +++ b/libmpcodecs/vd_raw.c Fri May 03 19:45:43 2002 +0000 @@ -65,10 +65,14 @@ 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;