# HG changeset patch # User reimar # Date 1390086513 0 # Node ID c9e8812156f4fb21cd891f167b8972241a38fae6 # Parent 93bf6748762706aab3b6e9212a1d6cda5e0b1cec vo_sdl: Avoid code duplication in DR code. diff -r 93bf67487627 -r c9e8812156f4 libvo/vo_sdl.c --- a/libvo/vo_sdl.c Sat Jan 18 23:08:32 2014 +0000 +++ b/libvo/vo_sdl.c Sat Jan 18 23:08:33 2014 +0000 @@ -1327,16 +1327,14 @@ if(mpi->flags&MP_IMGFLAG_PLANAR) { mpi->planes[0] = priv->overlay->pixels[0] + priv->y*priv->overlay->pitches[0]; mpi->stride[0] = priv->overlay->pitches[0]; - if(mpi->flags&MP_IMGFLAG_SWAPPED) { - mpi->planes[1] = priv->overlay->pixels[1] + priv->y*priv->overlay->pitches[1]/2; - mpi->stride[1] = priv->overlay->pitches[1]; - mpi->planes[2] = priv->overlay->pixels[2] + priv->y*priv->overlay->pitches[2]/2; - mpi->stride[2] = priv->overlay->pitches[2]; - } else { - mpi->planes[2] = priv->overlay->pixels[1] + priv->y*priv->overlay->pitches[1]/2; - mpi->stride[2] = priv->overlay->pitches[1]; - mpi->planes[1] = priv->overlay->pixels[2] + priv->y*priv->overlay->pitches[2]/2; - mpi->stride[1] = priv->overlay->pitches[2]; + mpi->planes[1] = priv->overlay->pixels[1] + priv->y*priv->overlay->pitches[1]/2; + mpi->stride[1] = priv->overlay->pitches[1]; + mpi->planes[2] = priv->overlay->pixels[2] + priv->y*priv->overlay->pitches[2]/2; + mpi->stride[2] = priv->overlay->pitches[2]; + // SDL order is considered swapped by MPlayer + if(!(mpi->flags&MP_IMGFLAG_SWAPPED)) { + FFSWAP(void *, mpi->planes[1], mpi->planes[2]); + FFSWAP(int, mpi->stride[1], mpi->stride[2]); } } else if(IMGFMT_IS_RGB(priv->format) || IMGFMT_IS_BGR(priv->format)) {