diff libvo/vo_gl.c @ 13575:d3ef52aafb54

fixed UNPACK_ALIGNMENT setting.
author reimar
date Wed, 06 Oct 2004 16:48:19 +0000
parents f85c105bfeaa
children 5a6e222fec86
line wrap: on
line diff
--- 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