[Mplayer-cvslog] CVS: main/libvo vo_gl.c, 1.48, 1.49 vo_gl2.c, 1.52, 1.53
Reimar Döffinger CVS
syncmail at mplayerhq.hu
Wed Oct 6 18:48:22 CEST 2004
CVS change done by Reimar Döffinger CVS
Update of /cvsroot/mplayer/main/libvo
In directory mail:/var2/tmp/cvs-serv16555/libvo
Modified Files:
vo_gl.c vo_gl2.c
Log Message:
fixed UNPACK_ALIGNMENT setting.
Index: vo_gl.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_gl.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- vo_gl.c 3 Sep 2004 12:12:17 -0000 1.48
+++ vo_gl.c 6 Oct 2004 16:48:19 -0000 1.49
@@ -248,6 +248,17 @@
glEnable(GL_TEXTURE_2D);
+ // set alignment as default is 4 which will break some files
+ if ((image_width * image_bytes) % 8 == 0)
+ gl_alignment=8;
+ else if ((image_width * image_bytes) % 4 == 0)
+ gl_alignment=4;
+ else if ((image_width * image_bytes) % 2 == 0)
+ gl_alignment=2;
+ else
+ gl_alignment=1;
+ glPixelStorei (GL_UNPACK_ALIGNMENT, gl_alignment);
+
mp_msg(MSGT_VO, MSGL_V, "[gl] Creating %dx%d texture...\n",texture_width,texture_height);
#if 1
Index: vo_gl2.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_gl2.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- vo_gl2.c 3 Oct 2004 21:42:31 -0000 1.52
+++ vo_gl2.c 6 Oct 2004 16:48:19 -0000 1.53
@@ -819,12 +819,13 @@
/**
* may give a little speed up for a kinda burst read ..
+ * Also, the default of 4 will break some files.
*/
- if( (image_width*image_bpp)%8 == 0 )
+ if( (image_width*image_bytes)%8 == 0 )
gl_alignment=8;
- else if( (image_width*image_bpp)%4 == 0 )
+ else if( (image_width*image_bytes)%4 == 0 )
gl_alignment=4;
- else if( (image_width*image_bpp)%2 == 0 )
+ else if( (image_width*image_bytes)%2 == 0 )
gl_alignment=2;
else
gl_alignment=1;
More information about the MPlayer-cvslog
mailing list