mirror of
https://github.com/mpv-player/mpv
synced 2024-12-19 05:15:12 +00:00
fixed UNPACK_ALIGNMENT setting.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13576 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
7663ab4a07
commit
4131acb7ff
@ -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
|
||||
|
@ -819,12 +819,13 @@ static int initGl(uint32_t d_width, uint32_t d_height)
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
Loading…
Reference in New Issue
Block a user