[MPlayer-cvslog] r35822 - trunk/gui/wm/ws.c

ib subversion at mplayerhq.hu
Tue Jan 22 16:37:18 CET 2013


Author: ib
Date: Tue Jan 22 16:37:17 2013
New Revision: 35822

Log:
Redefine PACK_RGB16 and PACK_RGB15.

First and third parameter were mixed up
which resulted in confusing calls.

Modified:
   trunk/gui/wm/ws.c

Modified: trunk/gui/wm/ws.c
==============================================================================
--- trunk/gui/wm/ws.c	Tue Jan 22 11:59:51 2013	(r35821)
+++ trunk/gui/wm/ws.c	Tue Jan 22 16:37:17 2013	(r35822)
@@ -80,17 +80,19 @@ static int wsUseXShape = True;
 
 /* --- */
 
-#define PACK_RGB16(r, g, b, pixel) pixel = (b >> 3); \
+#define PACK_RGB16(r, g, b, pixel) \
+    pixel   = (r >> 3); \
     pixel <<= 6; \
     pixel  |= (g >> 2); \
     pixel <<= 5; \
-    pixel  |= (r >> 3)
+    pixel  |= (b >> 3)
 
-#define PACK_RGB15(r, g, b, pixel) pixel = (b >> 3); \
+#define PACK_RGB15(r, g, b, pixel) \
+    pixel   = (r >> 3); \
     pixel <<= 5; \
     pixel  |= (g >> 3); \
     pixel <<= 5; \
-    pixel  |= (r >> 3)
+    pixel  |= (b >> 3)
 
 static enum AVPixelFormat out_pix_fmt = PIX_FMT_NONE;
 
@@ -1099,19 +1101,19 @@ void wsWindowBackground(wsWindow *win, i
         break;
 
     case wsRGB16:
-        PACK_RGB16(b, g, r, color);
+        PACK_RGB16(r, g, b, color);
         break;
 
     case wsBGR16:
-        PACK_RGB16(r, g, b, color);
+        PACK_RGB16(b, g, r, color);
         break;
 
     case wsRGB15:
-        PACK_RGB15(b, g, r, color);
+        PACK_RGB15(r, g, b, color);
         break;
 
     case wsBGR15:
-        PACK_RGB15(r, g, b, color);
+        PACK_RGB15(b, g, r, color);
         break;
     }
 


More information about the MPlayer-cvslog mailing list