From c2edb80335330b5f02059a0321c975e6b6718638 Mon Sep 17 00:00:00 2001 From: reimar Date: Thu, 27 Aug 2009 14:01:39 +0000 Subject: Remove useless code that has no effect. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29562 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_gl2.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'libvo/vo_gl2.c') diff --git a/libvo/vo_gl2.c b/libvo/vo_gl2.c index 9509001165..66ea359c4a 100644 --- a/libvo/vo_gl2.c +++ b/libvo/vo_gl2.c @@ -471,9 +471,6 @@ static int config_w32(uint32_t width, uint32_t height, uint32_t d_width, uint32_ if (!vo_w32_config(d_width, d_height, flags)) return -1; - if (vo_fs) - aspect(&d_width, &d_height, A_ZOOM); - return 0; } -- cgit v1.2.3 From f10dcbacd5e436f2a177c0b5f7d28f44e4e4d145 Mon Sep 17 00:00:00 2001 From: reimar Date: Thu, 27 Aug 2009 14:10:38 +0000 Subject: -vo gl2 resize does not need to modify its arguments, so pass int instead of int *. In particular, this avoids modifying vo_dwidth/vo_dheight which should only be modified by the "windowing layer" (w32_common, x11_common). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29564 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_gl2.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'libvo/vo_gl2.c') diff --git a/libvo/vo_gl2.c b/libvo/vo_gl2.c index 66ea359c4a..6e677a6b1d 100644 --- a/libvo/vo_gl2.c +++ b/libvo/vo_gl2.c @@ -419,23 +419,23 @@ static void drawTextureDisplay (void) } -static void resize(int *x,int *y){ - mp_msg(MSGT_VO,MSGL_V,"[gl2] Resize: %dx%d\n",*x,*y); +static void resize(int x,int y){ + mp_msg(MSGT_VO,MSGL_V,"[gl2] Resize: %dx%d\n",x,y); if( vo_fs ) { glClear(GL_COLOR_BUFFER_BIT); - aspect(x, y, A_ZOOM); + aspect(&x, &y, A_ZOOM); panscan_calc(); - *x += vo_panscan_x; - *y += vo_panscan_y; - glViewport( (vo_screenwidth-*x)/2, (vo_screenheight-*y)/2, *x, *y); + x += vo_panscan_x; + y += vo_panscan_y; + glViewport( (vo_screenwidth-x)/2, (vo_screenheight-y)/2, x, y); } else { //aspect(x, y, A_NOZOOM); if (WinID >= 0) { - int top = 0, left = 0, w = *x, h = *y; + int top = 0, left = 0, w = x, h = y; geometry(&top, &left, &w, &h, vo_screenwidth, vo_screenheight); glViewport(top, left, w, h); } else - glViewport( 0, 0, *x, *y ); + glViewport( 0, 0, x, y ); } glMatrixMode(GL_PROJECTION); @@ -597,7 +597,7 @@ static int initGl(uint32_t d_width, uint32_t d_height) glValName(gl_bitmap_format), glValName(gl_bitmap_type), rgb_sz, r_sz, g_sz, b_sz, a_sz, glValName(gl_internal_format)); - resize(&d_width, &d_height); + resize(d_width, d_height); glClearColor( 0.0f,0.0f,0.0f,0.0f ); glClear( GL_COLOR_BUFFER_BIT ); @@ -718,7 +718,7 @@ static void check_events(void) } #endif e=vo_check_events(); - if(e&VO_EVENT_RESIZE) resize(&vo_dwidth, &vo_dheight); + if(e&VO_EVENT_RESIZE) resize(vo_dwidth, vo_dheight); if(e&VO_EVENT_EXPOSE && int_pause) flip_page(); } @@ -891,7 +891,7 @@ static int control(uint32_t request, void *data, ...) vo_fullscreen(); if (setGlWindow(&gl_vinfo, &gl_context, vo_window) == SET_WINDOW_REINIT) initGl(vo_dwidth, vo_dheight); - resize(&vo_dwidth, &vo_dheight); + resize(vo_dwidth, vo_dheight); return VO_TRUE; case VOCTRL_BORDER: vo_border(); @@ -899,7 +899,7 @@ static int control(uint32_t request, void *data, ...) case VOCTRL_GET_PANSCAN: return VO_TRUE; case VOCTRL_SET_PANSCAN: - resize (&vo_dwidth, &vo_dheight); + resize(vo_dwidth, vo_dheight); return VO_TRUE; #ifndef GL_WIN32 case VOCTRL_SET_EQUALIZER: -- cgit v1.2.3 From 26d8e6a696bbce015966e7a3c69ebc14aa38f08b Mon Sep 17 00:00:00 2001 From: reimar Date: Thu, 27 Aug 2009 14:12:38 +0000 Subject: Fix video placement with -vo gl2 -fs -wid. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29565 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_gl2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libvo/vo_gl2.c') diff --git a/libvo/vo_gl2.c b/libvo/vo_gl2.c index 6e677a6b1d..c8ffce50e5 100644 --- a/libvo/vo_gl2.c +++ b/libvo/vo_gl2.c @@ -427,7 +427,7 @@ static void resize(int x,int y){ panscan_calc(); x += vo_panscan_x; y += vo_panscan_y; - glViewport( (vo_screenwidth-x)/2, (vo_screenheight-y)/2, x, y); + glViewport( (vo_dwidth-x)/2, (vo_dheight-y)/2, x, y); } else { //aspect(x, y, A_NOZOOM); if (WinID >= 0) { -- cgit v1.2.3 From f6e58b8a99359bab1e719bdecf036775e287db33 Mon Sep 17 00:00:00 2001 From: reimar Date: Thu, 27 Aug 2009 18:42:08 +0000 Subject: Make gl2 code capable of windowed aspect and panscan (no user option to enable it yet though). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29567 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_gl2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libvo/vo_gl2.c') diff --git a/libvo/vo_gl2.c b/libvo/vo_gl2.c index c8ffce50e5..654b34942a 100644 --- a/libvo/vo_gl2.c +++ b/libvo/vo_gl2.c @@ -421,10 +421,10 @@ static void drawTextureDisplay (void) static void resize(int x,int y){ mp_msg(MSGT_VO,MSGL_V,"[gl2] Resize: %dx%d\n",x,y); - if( vo_fs ) { + if(aspect_scaling()) { glClear(GL_COLOR_BUFFER_BIT); - aspect(&x, &y, A_ZOOM); - panscan_calc(); + aspect(&x, &y, A_WINZOOM); + panscan_calc_windowed(); x += vo_panscan_x; y += vo_panscan_y; glViewport( (vo_dwidth-x)/2, (vo_dheight-y)/2, x, y); @@ -738,7 +738,7 @@ flip_page(void) glFinish(); swapGlBuffers(); - if (vo_fs) // Avoid flickering borders in fullscreen mode + if (aspect_scaling()) // Avoid flickering borders in fullscreen mode glClear (GL_COLOR_BUFFER_BIT); } -- cgit v1.2.3 From a1f744cb07d006e2b8f02fbab94e5d94c09e8361 Mon Sep 17 00:00:00 2001 From: reimar Date: Tue, 1 Sep 2009 15:20:05 +0000 Subject: Check setGlWindow return value to fail properly instead of crashing if e.g. no OpenGL support is available. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29612 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_gl2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libvo/vo_gl2.c') diff --git a/libvo/vo_gl2.c b/libvo/vo_gl2.c index 654b34942a..a5e6050f44 100644 --- a/libvo/vo_gl2.c +++ b/libvo/vo_gl2.c @@ -637,7 +637,8 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin #endif return -1; - setGlWindow(&gl_vinfo, &gl_context, vo_window); + if (setGlWindow(&gl_vinfo, &gl_context, vo_window) == SET_WINDOW_FAILED) + return -1; glVersion = glGetString(GL_VERSION); -- cgit v1.2.3