diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-10-06 16:48:19 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-10-06 16:48:19 +0000 |
commit | 4131acb7ff26b61e516637e1416c35650573c94a (patch) | |
tree | ce3c5cc72cec0ee0862df0aa6650bb96ded4f81b /libvo/vo_gl.c | |
parent | 7663ab4a07ad6efe06c773de0e17fdbcd01332c9 (diff) |
fixed UNPACK_ALIGNMENT setting.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13576 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_gl.c')
-rw-r--r-- | libvo/vo_gl.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index c675f9167d..7aee1be15c 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -248,6 +248,17 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin 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 |