# HG changeset patch # User henry # Date 1101893568 0 # Node ID dc5eaa0795d73004fb250daa969955945a530cf3 # Parent 9e81af56f554115a144f9d9f80c1304d6fb44069 call draw_slice in top-down order (fixes crash with -vf expand=...,scale) diff -r 9e81af56f554 -r dc5eaa0795d7 libmpcodecs/vf_expand.c --- a/libmpcodecs/vf_expand.c Wed Dec 01 09:30:11 2004 +0000 +++ b/libmpcodecs/vf_expand.c Wed Dec 01 09:32:48 2004 +0000 @@ -257,7 +257,14 @@ static void draw_slice(struct vf_instance_s* vf, unsigned char** src, int* stride, int w,int h, int x, int y){ // printf("draw_slice() called %d at %d\n",h,y); + if(vf->priv->exp_y>0 && y == 0) + vf_next_draw_slice(vf, vf->dmpi->planes, vf->dmpi->stride, + vf->dmpi->w,vf->priv->exp_y,0,0); vf_next_draw_slice(vf,src,stride,w,h,x+vf->priv->exp_x,y+vf->priv->exp_y); + if(vf->priv->exp_y+vf->hdmpi->h && y+h == vf->h) + vf_next_draw_slice(vf, vf->dmpi->planes, vf->dmpi->stride, + vf->dmpi->w,vf->dmpi->h-(vf->priv->exp_y+vf->h), + 0,vf->priv->exp_y+vf->h); } static int put_image(struct vf_instance_s* vf, mp_image_t *mpi){ @@ -265,15 +272,6 @@ vf->dmpi=mpi->priv; if(!vf->dmpi) { printf("Why do we get NULL \n"); return 0; } mpi->priv=NULL; - if(mpi->flags&MP_IMGFLAG_DRAW_CALLBACK){ - if(vf->priv->exp_y>0) - vf_next_draw_slice(vf, vf->dmpi->planes, vf->dmpi->stride, - vf->dmpi->w,vf->priv->exp_y,0,0); - if(vf->priv->exp_y+mpi->hdmpi->h) - vf_next_draw_slice(vf, vf->dmpi->planes, vf->dmpi->stride, - vf->dmpi->w,vf->dmpi->h-(vf->priv->exp_y+mpi->h), - 0,vf->priv->exp_y+mpi->h); - } #ifdef OSD_SUPPORT if(vf->priv->osd) draw_osd(vf,mpi->w,mpi->h); #endif