summaryrefslogtreecommitdiffstats
path: root/libvo/vo_gl.c
diff options
context:
space:
mode:
Diffstat (limited to 'libvo/vo_gl.c')
-rw-r--r--libvo/vo_gl.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c
index 13ff34cd68..a97b524c56 100644
--- a/libvo/vo_gl.c
+++ b/libvo/vo_gl.c
@@ -159,18 +159,18 @@ static void resize(int x,int y){
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
ass_border_x = ass_border_y = 0;
- if (vo_fs && use_aspect) {
+ if (aspect_scaling() && use_aspect) {
int new_w, new_h;
GLdouble scale_x, scale_y;
- aspect(&new_w, &new_h, A_ZOOM);
- panscan_calc();
+ aspect(&new_w, &new_h, A_WINZOOM);
+ panscan_calc_windowed();
new_w += vo_panscan_x;
new_h += vo_panscan_y;
scale_x = (GLdouble)new_w / (GLdouble)x;
scale_y = (GLdouble)new_h / (GLdouble)y;
glScaled(scale_x, scale_y, 1);
- ass_border_x = (vo_screenwidth - new_w) / 2;
- ass_border_y = (vo_screenheight - new_h) / 2;
+ ass_border_x = (vo_dwidth - new_w) / 2;
+ ass_border_y = (vo_dheight - new_h) / 2;
}
glOrtho(0, image_width, image_height, 0, -1,1);
@@ -557,7 +557,8 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
glconfig:
if (vo_config_count)
uninitGl();
- setGlWindow(&gl_vinfo, &gl_context, vo_window);
+ if (setGlWindow(&gl_vinfo, &gl_context, vo_window) == SET_WINDOW_FAILED)
+ return -1;
initGl(vo_dwidth, vo_dheight);
return 0;
@@ -708,7 +709,7 @@ static void flip_page(void) {
if (vo_doublebuffering) {
if (use_glFinish) glFinish();
swapGlBuffers();
- if (vo_fs && use_aspect)
+ if (aspect_scaling() && use_aspect)
glClear(GL_COLOR_BUFFER_BIT);
} else {
do_render();
@@ -1131,14 +1132,12 @@ static int control(uint32_t request, void *data)
case VOCTRL_GET_EOSD_RES:
{
mp_eosd_res_t *r = data;
+ r->w = vo_dwidth; r->h = vo_dheight;
r->mt = r->mb = r->ml = r->mr = 0;
if (scaled_osd) {r->w = image_width; r->h = image_height;}
- else if (vo_fs) {
- r->w = vo_screenwidth; r->h = vo_screenheight;
+ else if (aspect_scaling()) {
r->ml = r->mr = ass_border_x;
r->mt = r->mb = ass_border_y;
- } else {
- r->w = vo_dwidth; r->h = vo_dheight;
}
}
return VO_TRUE;