[MPlayer-cvslog] r31705 - trunk/spudec.c

reimar subversion at mplayerhq.hu
Sun Jul 11 15:36:02 CEST 2010


Author: reimar
Date: Sun Jul 11 15:36:02 2010
New Revision: 31705

Log:
Fix conversion from paletted to MPlayer's OSD format.

Modified:
   trunk/spudec.c

Modified: trunk/spudec.c
==============================================================================
--- trunk/spudec.c	Sun Jul 11 15:05:45 2010	(r31704)
+++ trunk/spudec.c	Sun Jul 11 15:36:02 2010	(r31705)
@@ -1307,10 +1307,12 @@ void spudec_set_paletted(void *this, con
   for (y = 0; y < h; y++) {
     for (x = 0; x < w; x++) {
       uint32_t pixel = pal[pal_img[x]];
-      *aimg++ = -(pixel >> 24);
-      *img++  = (((pixel & 0x000000ff) >>  0) +
-                 ((pixel & 0x0000ff00) >>  7) +
-                 ((pixel & 0x00ff0000) >> 16)) >> 2;
+      int alpha = pixel >> 24;
+      int gray = (((pixel & 0x000000ff) >>  0) +
+                  ((pixel & 0x0000ff00) >>  7) +
+                  ((pixel & 0x00ff0000) >> 16)) >> 2;
+      *aimg++ = -alpha;
+      *img++  = FFMIN(gray, alpha);
     }
     for (; x < stride; x++)
       *aimg++ = *img++ = 0;


More information about the MPlayer-cvslog mailing list