comparison libvo/vo_gl.c @ 22149:7b4f17dc2689

Avoid calling aspect on each frame and make ass subtitles work better with panscan
author reimar
date Tue, 06 Feb 2007 19:26:58 +0000
parents ecd08be90726
children d0b60d14d8d7
comparison
equal deleted inserted replaced
22148:19bfd17ba231 22149:7b4f17dc2689
106 106
107 static int texture_width; 107 static int texture_width;
108 static int texture_height; 108 static int texture_height;
109 static int mpi_flipped; 109 static int mpi_flipped;
110 static int vo_flipped; 110 static int vo_flipped;
111 static int ass_border_x, ass_border_y;
111 112
112 static unsigned int slice_height = 1; 113 static unsigned int slice_height = 1;
113 114
114 static void resize(int x,int y){ 115 static void resize(int x,int y){
115 mp_msg(MSGT_VO, MSGL_V, "[gl] Resize: %dx%d\n",x,y); 116 mp_msg(MSGT_VO, MSGL_V, "[gl] Resize: %dx%d\n",x,y);
130 new_w += vo_panscan_x; 131 new_w += vo_panscan_x;
131 new_h += vo_panscan_y; 132 new_h += vo_panscan_y;
132 scale_x = (GLdouble) new_w / (GLdouble) x; 133 scale_x = (GLdouble) new_w / (GLdouble) x;
133 scale_y = (GLdouble) new_h / (GLdouble) y; 134 scale_y = (GLdouble) new_h / (GLdouble) y;
134 glScaled(scale_x, scale_y, 1); 135 glScaled(scale_x, scale_y, 1);
136 ass_border_x = (vo_screenwidth - new_w) / 2;
137 ass_border_y = (vo_screenheight - new_h) / 2;
135 } 138 }
136 glOrtho(0, image_width, image_height, 0, -1,1); 139 glOrtho(0, image_width, image_height, 0, -1,1);
137 140
138 glMatrixMode(GL_MODELVIEW); 141 glMatrixMode(GL_MODELVIEW);
139 glLoadIdentity(); 142 glLoadIdentity();
957 { 960 {
958 mp_eosd_res_t *r = data; 961 mp_eosd_res_t *r = data;
959 r->mt = r->mb = r->ml = r->mr = 0; 962 r->mt = r->mb = r->ml = r->mr = 0;
960 if (scaled_osd) {r->w = image_width; r->h = image_height;} 963 if (scaled_osd) {r->w = image_width; r->h = image_height;}
961 else if (vo_fs) { 964 else if (vo_fs) {
962 int aw, ah;
963 aspect(&aw, &ah, A_ZOOM);
964 r->w = vo_screenwidth; r->h = vo_screenheight; 965 r->w = vo_screenwidth; r->h = vo_screenheight;
965 r->ml = r->mr = (vo_screenwidth - aw) / 2; 966 r->ml = r->mr = ass_border_x > 0 ? ass_border_x : 0;
966 r->mt = r->mb = (vo_screenheight - ah) / 2; 967 r->mt = r->mb = ass_border_y > 0 ? ass_border_y : 0;
967 } else { 968 } else {
968 r->w = vo_dwidth; r->h = vo_dheight; 969 r->w = vo_dwidth; r->h = vo_dheight;
969 } 970 }
970 } 971 }
971 return VO_TRUE; 972 return VO_TRUE;