[MPlayer-cvslog] r35104 - trunk/libvo/gl_common.c

reimar subversion at mplayerhq.hu
Sat Aug 18 20:44:13 CEST 2012


Author: reimar
Date: Sat Aug 18 20:44:13 2012
New Revision: 35104

Log:
Hack to make BGRA work both in GL and GLES.

Modified:
   trunk/libvo/gl_common.c

Modified: trunk/libvo/gl_common.c
==============================================================================
--- trunk/libvo/gl_common.c	Sat Aug 18 20:19:57 2012	(r35103)
+++ trunk/libvo/gl_common.c	Sat Aug 18 20:44:13 2012	(r35104)
@@ -352,7 +352,7 @@ int glFindFormat(uint32_t fmt, int *bpp,
       *gl_type = GL_UNSIGNED_BYTE;
       break;
     case IMGFMT_BGRA:
-      *gl_texfmt = GL_BGRA;
+      *gl_texfmt = GL_RGBA;
       *gl_format = GL_BGRA;
       *gl_type = GL_UNSIGNED_BYTE;
       break;
@@ -567,6 +567,8 @@ void glCreateClearTex(GLenum target, GLe
   if (h == 0) h = 1;
   stride = w * glFmt2bpp(format, type);
   if (!stride) return;
+  // For BGRA internal format must be BGRA for GLES and RGBA for GL...
+  if (format == GL_BGRA && !mpglBegin) fmt = GL_BGRA;
   init = malloc(stride * h);
   memset(init, val, stride * h);
   glAdjustAlignment(stride);


More information about the MPlayer-cvslog mailing list