# HG changeset patch # User reimar # Date 1097081299 0 # Node ID d3ef52aafb5463b05730e35768aa65fff0ec4453 # Parent ae638e3c28085798b6f3878a270f64f8976c4b84 fixed UNPACK_ALIGNMENT setting. diff -r ae638e3c2808 -r d3ef52aafb54 libvo/vo_gl.c --- a/libvo/vo_gl.c Wed Oct 06 16:46:35 2004 +0000 +++ b/libvo/vo_gl.c Wed Oct 06 16:48:19 2004 +0000 @@ -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 diff -r ae638e3c2808 -r d3ef52aafb54 libvo/vo_gl2.c --- a/libvo/vo_gl2.c Wed Oct 06 16:46:35 2004 +0000 +++ b/libvo/vo_gl2.c Wed Oct 06 16:48:19 2004 +0000 @@ -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;