# HG changeset patch # User arpi # Date 1023489571 0 # Node ID ff858ab25b11698e638a51e22611f0fe76fb1bf4 # Parent 0d24f3ba4d9a9c5bab9700f46e11353d6fd9181e -vm pan&scan fixes by Jesper Svennevid osd fixed by me (don't draw osd outside of visible area) diff -r 0d24f3ba4d9a -r ff858ab25b11 libvo/vo_xv.c --- a/libvo/vo_xv.c Fri Jun 07 22:17:27 2002 +0000 +++ b/libvo/vo_xv.c Fri Jun 07 22:39:31 2002 +0000 @@ -101,18 +101,21 @@ static void (*draw_alpha_fnc)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride); static void draw_alpha_yv12(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ + x0+=(vo_panscan_x>>2); vo_draw_alpha_yv12(w,h,src,srca,stride, xvimage[current_buf]->data+xvimage[current_buf]->offsets[0]+ xvimage[current_buf]->pitches[0]*y0+x0,xvimage[current_buf]->pitches[0]); } static void draw_alpha_yuy2(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ + x0+=(vo_panscan_x>>2); vo_draw_alpha_yuy2(w,h,src,srca,stride, xvimage[current_buf]->data+xvimage[current_buf]->offsets[0]+ xvimage[current_buf]->pitches[0]*y0+2*x0,xvimage[current_buf]->pitches[0]); } static void draw_alpha_uyvy(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ + x0+=(vo_panscan_x>>2); vo_draw_alpha_yuy2(w,h,src,srca,stride, xvimage[current_buf]->data+xvimage[current_buf]->offsets[0]+ xvimage[current_buf]->pitches[0]*y0+2*x0+1,xvimage[current_buf]->pitches[0]); @@ -594,7 +597,7 @@ } static void draw_osd(void) -{ vo_draw_text(image_width,image_height,draw_alpha_fnc);} +{ vo_draw_text(image_width-(vo_panscan_x>>1),image_height,draw_alpha_fnc);} static void flip_page(void) { @@ -853,20 +856,25 @@ return query_format(*((uint32_t*)data)); case VOCTRL_GET_IMAGE: return get_image(data); - case VOCTRL_FULLSCREEN: - vo_x11_fullscreen(); - return VO_TRUE; case VOCTRL_GUISUPPORT: return VO_TRUE; case VOCTRL_GET_PANSCAN: if ( !vo_config_count || !vo_fs ) return VO_FALSE; return VO_TRUE; + case VOCTRL_FULLSCREEN: + vo_x11_fullscreen(); + /* indended, fallthrough to update panscan on fullscreen/windowed switch */ case VOCTRL_SET_PANSCAN: - if ( vo_fs && ( vo_panscan != vo_panscan_amount ) ) + if ( ( vo_fs && ( vo_panscan != vo_panscan_amount ) ) || ( !vo_fs && vo_panscan_amount ) ) { + int old_y = vo_panscan_y; panscan_calc(); - XClearWindow(mDisplay, vo_window); - XFlush(mDisplay); + + if(old_y != vo_panscan_y) + { + XClearWindow(mDisplay, vo_window); + XFlush(mDisplay); + } } return VO_TRUE; }