Index: libavcodec/mjpeg.c =================================================================== --- libavcodec/mjpeg.c (revision 6237) +++ libavcodec/mjpeg.c (working copy) @@ -1462,10 +1462,21 @@ return 0; } +extern struct { int x,y,w,h, fullw, fullh; } vd_visible; // is defined in libmpcodecs/dec_video.c + static int mjpeg_decode_scan(MJpegDecodeContext *s){ int i, mb_x, mb_y; const int nb_components=3; + int x1=vd_visible.x+vd_visible.w; + int y1=vd_visible.y+vd_visible.h; + int px, py; + if (vd_visible.w<=0 || vd_visible.h<=0) return 0; + if ((vd_visible.fullw+15 >> 4 << s->avctx->lowres) != s->mb_width + || (vd_visible.fullh+15 >> 4 << s->avctx->lowres) != s->mb_height) { // picture size does not accord + vd_visible.x=vd_visible.y=0; + x1=y1=1<<30; + } for(mb_y = 0; mb_y < s->mb_height; mb_y++) { for(mb_x = 0; mb_x < s->mb_width; mb_x++) { if (s->restart_interval && !s->restart_count) @@ -1495,7 +1506,10 @@ if (s->interlaced && s->bottom_field) ptr += s->linesize[c] >> 1; //av_log(NULL, AV_LOG_DEBUG, "%d %d %d %d %d %d %d %d \n", mb_x, mb_y, x, y, c, s->bottom_field, (v * mb_y + y) * 8, (h * mb_x + x) * 8); - s->idct_put(ptr, s->linesize[c], s->block); + px = (mb_x*2+x)*8 >> s->avctx->lowres; + py = (mb_y*2+y)*8 >> s->avctx->lowres; + if (px+16/h-1 >= vd_visible.x && px < x1 + && py+16/v-1 >= vd_visible.y && py < y1) s->idct_put(ptr, s->linesize[c], s->block); if (++x == h) { x = 0; y++; Index: libmpcodecs/vf_rotate.c =================================================================== --- libmpcodecs/vf_rotate.c (revision 19808) +++ libmpcodecs/vf_rotate.c (working copy) @@ -115,8 +115,23 @@ return 0; } +static void get_visible(struct vf_instance_s* vf, vf_vis_part_t* vr){ + int sfw=vr->fullw, sfh=vr->fullh, t; + + vr->fullw=sfh; vr->fullh=sfw; + vf->next->get_visible(vf->next, vr); + vr->fullw=sfw; vr->fullh=sfh; + + t=vr->x; vr->x=vr->y; vr->y=t; + t=vr->w; vr->w=vr->h; vr->h=t; + if((vf->priv->direction&2) && vr->fullw > 0) vr->x = vr->fullw - vr->x - vr->w; + if((vf->priv->direction&1) && vr->fullh > 0) vr->y = vr->fullh - vr->y - vr->h; + mp_msg(MSGT_VFILTER, MSGL_DBG4, "\rvf-rotate visible: (%dx%d%+d%+d);\n", vr->w,vr->h, vr->x,vr->y); +} + static int open(vf_instance_t *vf, char* args){ vf->config=config; + vf->get_visible=get_visible; vf->put_image=put_image; vf->query_format=query_format; vf->priv=malloc(sizeof(struct vf_priv_s)); Index: libmpcodecs/vf_vo.c =================================================================== --- libmpcodecs/vf_vo.c (revision 19808) +++ libmpcodecs/vf_vo.c (working copy) @@ -9,6 +9,7 @@ #include "vf.h" #include "libvo/video_out.h" +#include "libvo/sub.h" #ifdef USE_ASS #include "libass/ass.h" @@ -20,6 +21,7 @@ extern int sub_visibility; extern double sub_delay; +int osd_function=OSD_PLAY; typedef struct vf_vo_data_s { double pts; @@ -153,6 +155,16 @@ return flags; } +static void get_visible(struct vf_instance_s* vf, vf_vis_part_t* vr) { + // if paused we need full picture for scroll + if(osd_function==OSD_PAUSE || video_out->control(VOCTRL_GET_VISIBLE, vr)==VO_NOTIMPL){ + vr->x = vr->y = 0; + vr->w = vr->h = 1<<30; + } + mp_msg(MSGT_VFILTER, MSGL_DBG4, "\rvf-vo: (%dx%d%+d%+d);\n", vr->w,vr->h, vr->x,vr->y); + return; +} + static void get_image(struct vf_instance_s* vf, mp_image_t *mpi){ if(vo_directrendering && vo_config_count) @@ -206,6 +218,7 @@ vf->config=config; vf->control=control; vf->query_format=query_format; + vf->get_visible=get_visible; vf->get_image=get_image; vf->put_image=put_image; vf->draw_slice=draw_slice; Index: libmpcodecs/vf_perspective.c =================================================================== --- libmpcodecs/vf_perspective.c (revision 19808) +++ libmpcodecs/vf_perspective.c (working copy) @@ -303,10 +303,18 @@ return 0; } +static void get_visible(struct vf_instance_s* vf, vf_vis_part_t* vr){ + vf->next->get_visible(vf->next, vr); + vr->x=vr->y=0; //FIXME + vr->w=vr->h=1<<30; + mp_msg(MSGT_VFILTER, MSGL_DBG4, "\rvf-perspective visible: (%dx%d%+d%+d);\n", vr->w,vr->h, vr->x,vr->y); +} + static int open(vf_instance_t *vf, char* args){ int e; vf->config=config; + vf->get_visible=get_visible; vf->put_image=put_image; // vf->get_image=get_image; vf->query_format=query_format; Index: libmpcodecs/vf_crop.c =================================================================== --- libmpcodecs/vf_crop.c (revision 19808) +++ libmpcodecs/vf_crop.c (working copy) @@ -68,6 +68,32 @@ return vf_next_config(vf,vf->priv->crop_w,vf->priv->crop_h,d_width,d_height,flags,outfmt); } +static void get_visible(struct vf_instance_s* vf, vf_vis_part_t* vr){ + int sfw=vr->fullw, sfh=vr->fullh; + + if(vf->priv->crop_w > 0 && vr->fullw > vf->priv->crop_w) vr->fullw=vf->priv->crop_w; + if(vf->priv->crop_h > 0 && vr->fullh > vf->priv->crop_h) vr->fullh=vf->priv->crop_h; + vf->next->get_visible(vf->next, vr); + vr->fullw = sfw; + vr->fullh = sfh; + + if(vf->priv->crop_x<0) { vr->w=1<<30; vr->x=0; } + else { + int w=vf->priv->crop_w; + if(vr->x>=0) { w-=vr->x; vr->x+=vf->priv->crop_x; } + else { vr->w+=vr->x; vr->x=vf->priv->crop_x; } + if(vf->priv->crop_w >= 0 && vr->w > w) vr->w = w; + } + if(vf->priv->crop_y<0) { vr->h=1<<30; vr->y=0; } + else { + int h=vf->priv->crop_h; + if(vr->y>=0) { h-=vr->y; vr->y+=vf->priv->crop_y;} + else { vr->h+=vr->y; vr->y=vf->priv->crop_y; } + if(vf->priv->crop_h >= 0 && vr->h > h) vr->h = h; + } + mp_msg(MSGT_VFILTER, MSGL_DBG4, "\rvf-crop visible: (%dx%d%+d%+d);\n", vr->w,vr->h, vr->x,vr->y); +} + static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){ mp_image_t *dmpi; if (mpi->flags&MP_IMGFLAG_DRAW_CALLBACK) @@ -140,6 +166,7 @@ static int open(vf_instance_t *vf, char* args){ vf->config=config; + vf->get_visible=get_visible; vf->put_image=put_image; vf->start_slice=start_slice; vf->draw_slice=draw_slice; Index: libmpcodecs/vf_fil.c =================================================================== --- libmpcodecs/vf_fil.c (revision 19808) +++ libmpcodecs/vf_fil.c (working copy) @@ -78,8 +78,21 @@ free(vf->priv); } +static void get_visible(struct vf_instance_s* vf, vf_vis_part_t* vr){ + int sfw=vr->fullw, sfh=vr->fullh; + + //vr->fullw*=2; vr->fullh*=2; //FIXME + vf->next->get_visible(vf->next, vr); + vr->fullw=sfw; vr->fullh=sfh; + + vr->w=vr->h=1<<30; + vr->x=vr->y=0; + mp_msg(MSGT_VFILTER, MSGL_DBG4, "\rvf-fil visible: (%dx%d%+d%+d);\n", vr->w,vr->h, vr->x,vr->y); +} + static int open(vf_instance_t *vf, char* args){ vf->config=config; + vf->get_visible=get_visible; vf->put_image=put_image; vf->uninit=uninit; vf->default_reqs=VFCAP_ACCEPT_STRIDE; Index: libmpcodecs/vf_cropdetect.c =================================================================== --- libmpcodecs/vf_cropdetect.c (revision 19808) +++ libmpcodecs/vf_cropdetect.c (working copy) @@ -146,10 +146,18 @@ } return 0; } + +static void get_visible(struct vf_instance_s* vf, vf_vis_part_t* vr){ + vf->next->get_visible(vf->next, vr); + vr->x=vr->y=0; + vr->w=vr->h=1<<30; + mp_msg(MSGT_VFILTER, MSGL_DBG4, "\rvf-cropdetect visible: (%dx%d%+d%+d);\n", vr->w,vr->h, vr->x,vr->y); +} //===========================================================================// static int open(vf_instance_t *vf, char* args){ vf->config=config; + vf->get_visible=get_visible; vf->put_image=put_image; vf->query_format=query_format; vf->priv=malloc(sizeof(struct vf_priv_s)); Index: libmpcodecs/vf_expand.c =================================================================== --- libmpcodecs/vf_expand.c (revision 19808) +++ libmpcodecs/vf_expand.c (working copy) @@ -376,6 +376,29 @@ return vf_next_put_image(vf,vf->dmpi, pts); } +static void get_visible(struct vf_instance_s* vf, vf_vis_part_t* vr){ + int sfw=vr->fullw, sfh=vr->fullh; + if(sfw>0 && sfh>0) { + if(vf->priv->exp_w<0)vr->fullw-=vf->priv->exp_w; + else vr->fullw=vf->priv->exp_w; + if(vf->priv->exp_h<0)vr->fullh-=vf->priv->exp_h; + else vr->fullh=vf->priv->exp_h; + } + vf->next->get_visible(vf->next, vr); + if(sfw>0 && sfh>0) { + vr->x-= vf->priv->exp_x>0? vf->priv->exp_x : (vr->fullw-sfw)/2; + vr->y-= vf->priv->exp_y>0? vf->priv->exp_y : (vr->fullh-sfh)/2; + if(vr->x<0) { vr->w+=vr->x; vr->x=0; } + if(vr->y<0) { vr->h+=vr->y; vr->y=0; } + if(vr->w>sfw-vr->x) vr->w=sfw-vr->x; + if(vr->h>sfh-vr->y) vr->h=sfh-vr->y; + } + //vr->x=vr->y=0; // FIXME + //vr->w=vr->h=1<<30; + mp_msg(MSGT_VFILTER, MSGL_DBG4, "\rvf-expand visible: (%dx%d%+d%+d);\n", vr->w,vr->h, vr->x,vr->y); + vr->fullw = sfw; vr->fullh = sfh; +} + //===========================================================================// static int control(struct vf_instance_s* vf, int request, void* data){ @@ -390,6 +413,7 @@ static int open(vf_instance_t *vf, char* args){ vf->config=config; + vf->get_visible=get_visible; vf->control=control; vf->start_slice=start_slice; vf->draw_slice=draw_slice; Index: libmpcodecs/dec_video.c =================================================================== --- libmpcodecs/dec_video.c (revision 19808) +++ libmpcodecs/dec_video.c (working copy) @@ -315,6 +315,8 @@ extern int vo_directrendering; +vf_vis_part_t vd_visible = { 0,0, 1<<30,1<<30, -1,-1 }; // -1 means image size is unknown + int decode_video(sh_video_t *sh_video,unsigned char *start,int in_size,int drop_frame, double pts){ vf_instance_t* vf; mp_image_t *mpi=NULL; @@ -353,8 +355,15 @@ } } +vf=sh_video->vfilter; +vf->get_visible(vf, &vd_visible); // calculate frame visible part before decoding + //if(!(sh_video->ds->flags&1) || sh_video->ds->pack_no<5) mpi=mpvdec->decode(sh_video, start, in_size, drop_frame); +if(mpi) { + vd_visible.fullw=mpi->w; // store for the next frame + vd_visible.fullh=mpi->h; +} //------------------------ frame decoded. -------------------- Index: libmpcodecs/vf_il.c =================================================================== --- libmpcodecs/vf_il.c (revision 19808) +++ libmpcodecs/vf_il.c (working copy) @@ -123,9 +123,19 @@ if(pos && posinterleave=-1; } +static void get_visible(struct vf_instance_s* vf, vf_vis_part_t* vr){ + + vf->next->get_visible(vf->next, vr); + + vr->w=vr->h=1<<30; + vr->x=vr->y=0; + mp_msg(MSGT_VFILTER, MSGL_DBG4, "\rvf-il visible: (%dx%d%+d%+d);\n", vr->w,vr->h, vr->x,vr->y); +} + static int open(vf_instance_t *vf, char* args){ vf->put_image=put_image; + vf->get_visible=get_visible; // vf->get_image=get_image; vf->priv=malloc(sizeof(struct vf_priv_s)); memset(vf->priv, 0, sizeof(struct vf_priv_s)); Index: libmpcodecs/vf_field.c =================================================================== --- libmpcodecs/vf_field.c (revision 19808) +++ libmpcodecs/vf_field.c (working copy) @@ -50,8 +50,20 @@ free(vf->priv); } +static void get_visible(struct vf_instance_s* vf, vf_vis_part_t* vr){ + int sfh=vr->fullh; + + vr->fullh/=2; + vf->next->get_visible(vf->next, vr); + vr->fullh=sfh; + + vr->h*=2; vr->y*=2; + mp_msg(MSGT_VFILTER, MSGL_DBG4, "\rvf-field visible: (%dx%d%+d%+d);\n", vr->w,vr->h, vr->x,vr->y); +} + static int open(vf_instance_t *vf, char* args){ vf->config=config; + vf->get_visible=get_visible; vf->put_image=put_image; vf->uninit=uninit; vf->default_reqs=VFCAP_ACCEPT_STRIDE; Index: libmpcodecs/mp_image.h =================================================================== --- libmpcodecs/mp_image.h (revision 19808) +++ libmpcodecs/mp_image.h (working copy) @@ -1,5 +1,6 @@ #ifndef __MP_IMAGE_H #define __MP_IMAGE_H 1 +#include //--------- codec's requirements (filled by the codec/vf) --------- Index: libmpcodecs/vf_scale.c =================================================================== --- libmpcodecs/vf_scale.c (revision 19808) +++ libmpcodecs/vf_scale.c (working copy) @@ -456,8 +456,19 @@ free(vf->priv); } +static void get_visible(struct vf_instance_s* vf, vf_vis_part_t* vr){ + int sfw=vr->fullw, sfh=vr->fullh; + vr->fullw=vf->priv->w; vr->fullh=vf->priv->h; + vf->next->get_visible(vf->next, vr); + vr->x=vr->y=0; //FIXME + vr->w=vr->h=1<<30; + vr->fullw = sfw; vr->fullh = sfh; + mp_msg(MSGT_VFILTER, MSGL_DBG4, "\rvf-scale visible: (%dx%d%+d%+d);\n", vr->w,vr->h, vr->x,vr->y); +} + static int open(vf_instance_t *vf, char* args){ vf->config=config; + vf->get_visible=get_visible; vf->start_slice=start_slice; vf->draw_slice=draw_slice; vf->put_image=put_image; Index: libmpcodecs/vf_flip.c =================================================================== --- libmpcodecs/vf_flip.c (revision 19808) +++ libmpcodecs/vf_flip.c (working copy) @@ -19,6 +19,14 @@ return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt); } +static void get_visible(struct vf_instance_s* vf, vf_vis_part_t* vr){ + + vf->next->get_visible(vf->next, vr); + + if(vr->fullh > 0) vr->y = vr->fullh - vr->y - vr->h; + mp_msg(MSGT_VFILTER, MSGL_DBG4, "\rvf-flip visible: (%dx%d%+d%+d);\n", vr->w,vr->h, vr->x,vr->y); +} + static void get_image(struct vf_instance_s* vf, mp_image_t *mpi){ if(mpi->flags&MP_IMGFLAG_ACCEPT_STRIDE){ // try full DR ! @@ -74,6 +82,7 @@ static int open(vf_instance_t *vf, char* args){ vf->config=config; + vf->get_visible=get_visible; vf->get_image=get_image; vf->put_image=put_image; vf->default_reqs=VFCAP_ACCEPT_STRIDE; Index: libmpcodecs/vf_mirror.c =================================================================== --- libmpcodecs/vf_mirror.c (revision 19808) +++ libmpcodecs/vf_mirror.c (working copy) @@ -97,8 +97,17 @@ //===========================================================================// +static void get_visible(struct vf_instance_s* vf, vf_vis_part_t* vr){ + + vf->next->get_visible(vf->next, vr); + + if(vr->fullw > 0) vr->x = vr->fullw - vr->x - vr->w; + mp_msg(MSGT_VFILTER, MSGL_DBG4, "\rvf-mirror visible: (%dx%d%+d%+d);\n", vr->w,vr->h, vr->x,vr->y); +} + static int open(vf_instance_t *vf, char* args){ //vf->config=config; + vf->get_visible=get_visible; vf->put_image=put_image; return 1; } Index: libmpcodecs/vf.c =================================================================== --- libmpcodecs/vf.c (revision 19808) +++ libmpcodecs/vf.c (working copy) @@ -438,6 +438,17 @@ return vf_next_query_format(vf,fmt); } +static void vf_default_get_visible(struct vf_instance_s* vf, vf_vis_part_t* vr) { + if(vf->next) + vf->next->get_visible(vf->next, vr); +// else { + vr->x = vr->y = 0; + vr->w = vr->h = 1<<30; +// } + mp_msg(MSGT_VFILTER,MSGL_DBG4,"\r%s (%dx%d%+d%+d);\n", vf->info->name, vr->w,vr->h, vr->x,vr->y); + return; +} + vf_instance_t* vf_open_plugin(vf_info_t** filter_list, vf_instance_t* next, const char *name, char **args){ vf_instance_t* vf; int i; @@ -455,6 +466,7 @@ vf->config=vf_next_config; vf->control=vf_next_control; vf->query_format=vf_default_query_format; + vf->get_visible=vf_default_get_visible; vf->put_image=vf_next_put_image; vf->default_caps=VFCAP_ACCEPT_STRIDE; vf->default_reqs=0; Index: libmpcodecs/vf.h =================================================================== --- libmpcodecs/vf.h (revision 19808) +++ libmpcodecs/vf.h (working copy) @@ -1,3 +1,5 @@ +#ifndef VF_H +#define VF_H struct vf_instance_s; struct vf_priv_s; @@ -24,6 +26,10 @@ int orig_width, orig_height, orig_fmt; } vf_format_context_t; +typedef struct vf_vis_part_s { + int x,y, w,h, fullw,fullh; +} vf_vis_part_t; + typedef struct vf_instance_s { vf_info_t* info; // funcs: @@ -34,6 +40,7 @@ int request, void* data); int (*query_format)(struct vf_instance_s* vf, unsigned int fmt); + void (*get_visible)(struct vf_instance_s* vf, vf_vis_part_t* vr); void (*get_image)(struct vf_instance_s* vf, mp_image_t *mpi); int (*put_image)(struct vf_instance_s* vf, @@ -119,3 +126,4 @@ int vf_config_wrapper(struct vf_instance_s* vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt); +#endif /* VF_H */ Index: libmpcodecs/vf_2xsai.c =================================================================== --- libmpcodecs/vf_2xsai.c (revision 19808) +++ libmpcodecs/vf_2xsai.c (working copy) @@ -345,8 +345,22 @@ return 0; } +static void get_visible(struct vf_instance_s* vf, vf_vis_part_t* vr){ + int sfw=vr->fullw, sfh=vr->fullh; + + vr->fullw*=2; vr->fullh*=2; + vf->next->get_visible(vf->next, vr); + vr->fullw=sfw; vr->fullh=sfh; + + vr->w/=2; vr->h/=2; + if(vr->x&1)vr->w++; if(vr->y&1)vr->h++; + vr->x/=2; vr->y/=2; + mp_msg(MSGT_VFILTER, MSGL_DBG4, "\rvf-2xsai visible: (%dx%d%+d%+d);\n", vr->w,vr->h, vr->x,vr->y); +} + static int open(vf_instance_t *vf, char* args){ vf->config=config; + vf->get_visible=get_visible; vf->put_image=put_image; vf->query_format=query_format; return 1; Index: libvo/x11_common.c =================================================================== --- libvo/x11_common.c (revision 19808) +++ libvo/x11_common.c (working copy) @@ -1157,6 +1157,35 @@ } /** + * \brief get the visible rectangle of the video window + */ +void vo_x11_get_visible(struct vf_vis_part_s *rect) +{ + int dx,dy,w,h, x0,y0; + Window w1, w0, *children; + + int junk; + + XGetGeometry(mDisplay, (w1=vo_window?vo_window:mRootWin), &mRootWin, &x0, &y0, &rect->w, &rect->h, + &junk, &junk); + x0-=rect->x; y0-=rect->y; + rect->x=-x0; rect->y=-y0; + for(;w1;w1=w0) { + XQueryTree(mDisplay, w1, &mRootWin, &w0, &children, &junk); + if(children)XFree(children); + if(!w0) break; + XGetGeometry(mDisplay, w0, &mRootWin, &dx, &dy, &w, &h, &junk, &junk); + + w-=rect->x+x0; h-=rect->y+y0; + if(rect->w>w) rect->w=w; if(rect->h>h) rect->h=h; + if(w0==mRootWin) break; + x0+=dx; y0+=dy; + if(-x0 > rect->x) { rect->w += x0+rect->x; rect->x=-x0; } + if(-y0 > rect->y) { rect->h += y0+rect->y; rect->y=-y0; } + } +} + +/** * \brief sets the size and position of the non-fullscreen window. */ void vo_x11_nofs_sizepos(int x, int y, int width, int height) Index: libvo/x11_common.h =================================================================== --- libvo/x11_common.h (revision 19808) +++ libvo/x11_common.h (working copy) @@ -2,6 +2,9 @@ #ifndef X11_COMMON_H #define X11_COMMON_H +#include "libmpcodecs/mp_image.h" +#include "libmpcodecs/vf.h" + #include #include @@ -41,6 +44,7 @@ extern void vo_showcursor( Display *disp, Window win ); extern void vo_x11_decoration( Display * vo_Display,Window w,int d ); extern void vo_x11_classhint( Display * display,Window window,char *name ); +extern void vo_x11_get_visible(vf_vis_part_t *rect); extern void vo_x11_nofs_sizepos(int x, int y, int width, int height); extern void vo_x11_sizehint( int x, int y, int width, int height, int max ); extern int vo_x11_check_events(Display *mydisplay); Index: libvo/video_out.h =================================================================== --- libvo/video_out.h (revision 19808) +++ libvo/video_out.h (working copy) @@ -64,6 +64,7 @@ int w, h; // screen dimensions, including black borders int mt, mb, ml, mr; // borders (top, bottom, left, right) } mp_eosd_res_t; +#define VOCTRL_GET_VISIBLE 30 // Vo can be used by xover #define VOCTRL_XOVERLAY_SUPPORT 22 Index: libvo/vo_x11.c =================================================================== --- libvo/vo_x11.c (revision 19808) +++ libvo/vo_x11.c (working copy) @@ -39,6 +39,7 @@ #include "sub.h" #include "libswscale/swscale.h" +#include "libswscale/swscale_internal.h" #include "libmpcodecs/vf_scale.h" #define MODE_RGB 0x1 #define MODE_BGR 0x2 @@ -767,6 +768,24 @@ return VO_TRUE; case VOCTRL_GET_IMAGE: return get_image(data); + case VOCTRL_GET_VISIBLE: + if(swsContext) { + ((vf_vis_part_t*)data)->x = (swsContext->dstW - vo_dwidth) / 2; + ((vf_vis_part_t*)data)->y = (swsContext->dstH - vo_dheight) / 2; + }else{ + ((vf_vis_part_t*)data)->x = ((vf_vis_part_t*)data)->y = 0; + } + vo_x11_get_visible(data); + if(!swsContext) return VO_TRUE; + if(swsContext->dstW>0 && srcW!=swsContext->dstW) { + ((vf_vis_part_t*)data)->w = ( ((vf_vis_part_t*)data)->w * srcW + swsContext->dstW - 1 ) / swsContext->dstW; + ((vf_vis_part_t*)data)->x = ((vf_vis_part_t*)data)->x * srcW / swsContext->dstW; + } + if(swsContext->dstH>0 && srcH!=swsContext->dstH) { + ((vf_vis_part_t*)data)->h = ( ((vf_vis_part_t*)data)->h * srcH + swsContext->dstH - 1 ) / swsContext->dstH; + ((vf_vis_part_t*)data)->y = ((vf_vis_part_t*)data)->y * srcH / swsContext->dstH; + } + return VO_TRUE; case VOCTRL_SET_EQUALIZER: { va_list ap; Index: mplayer.c =================================================================== --- mplayer.c (revision 19808) +++ mplayer.c (working copy) @@ -240,7 +240,7 @@ int osd_level_saved=-1; // if nonzero, hide current OSD contents when GetTimerMS() reaches this unsigned int osd_visible; -static int osd_function=OSD_PLAY; +extern int osd_function; // is in libmpcodecs/vf_vo.c static int osd_show_percentage = 0; static int osd_duration = 1000;