[MPlayer-cvslog] r36618 - trunk/libvo/vo_sdl.c

reimar subversion at mplayerhq.hu
Sun Jan 19 00:08:33 CET 2014


Author: reimar
Date: Sun Jan 19 00:08:33 2014
New Revision: 36618

Log:
vo_sdl: Avoid code duplication in DR code.

Modified:
   trunk/libvo/vo_sdl.c

Modified: trunk/libvo/vo_sdl.c
==============================================================================
--- trunk/libvo/vo_sdl.c	Sun Jan 19 00:08:32 2014	(r36617)
+++ trunk/libvo/vo_sdl.c	Sun Jan 19 00:08:33 2014	(r36618)
@@ -1327,16 +1327,14 @@ static uint32_t get_image(mp_image_t *mp
         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)) {


More information about the MPlayer-cvslog mailing list