Mercurial > mplayer.hg
comparison libmpcodecs/vf_expand.c @ 15099:bfb91d085f22
fix displaying of the subtitles when using slices
author | henry |
---|---|
date | Sun, 10 Apr 2005 15:37:43 +0000 |
parents | dc5eaa0795d7 |
children | b5456142675d |
comparison
equal
deleted
inserted
replaced
15098:e73beba537fe | 15099:bfb91d085f22 |
---|---|
139 if(vf->priv->exp_w!=w || vf->priv->exp_h!=h || | 139 if(vf->priv->exp_w!=w || vf->priv->exp_h!=h || |
140 vf->priv->exp_x || vf->priv->exp_y){ | 140 vf->priv->exp_x || vf->priv->exp_y){ |
141 // yep, we're expanding image, not just copy. | 141 // yep, we're expanding image, not just copy. |
142 if(vf->dmpi->planes[0]!=vf->priv->fb_ptr){ | 142 if(vf->dmpi->planes[0]!=vf->priv->fb_ptr){ |
143 // double buffering, so we need full clear :( | 143 // double buffering, so we need full clear :( |
144 remove_func(0,0,vf->priv->exp_w,vf->priv->exp_h); | 144 if (vf->priv->exp_y > 0) |
145 remove_func_2(0,0,vf->priv->exp_w,vf->priv->exp_y); | |
146 if (vf->priv->exp_y+h < vf->priv->exp_h) | |
147 remove_func_2(0,vf->priv->exp_y+h,vf->priv->exp_w,vf->priv->exp_h-h-vf->priv->exp_y); | |
145 } else { | 148 } else { |
146 // partial clear: | 149 // partial clear: |
147 vo_remove_text(vf->priv->exp_w,vf->priv->exp_h,remove_func); | 150 vo_remove_text(vf->priv->exp_w,vf->priv->exp_h,remove_func); |
148 } | 151 } |
149 } | 152 } |
259 // printf("draw_slice() called %d at %d\n",h,y); | 262 // printf("draw_slice() called %d at %d\n",h,y); |
260 if(vf->priv->exp_y>0 && y == 0) | 263 if(vf->priv->exp_y>0 && y == 0) |
261 vf_next_draw_slice(vf, vf->dmpi->planes, vf->dmpi->stride, | 264 vf_next_draw_slice(vf, vf->dmpi->planes, vf->dmpi->stride, |
262 vf->dmpi->w,vf->priv->exp_y,0,0); | 265 vf->dmpi->w,vf->priv->exp_y,0,0); |
263 vf_next_draw_slice(vf,src,stride,w,h,x+vf->priv->exp_x,y+vf->priv->exp_y); | 266 vf_next_draw_slice(vf,src,stride,w,h,x+vf->priv->exp_x,y+vf->priv->exp_y); |
264 if(vf->priv->exp_y+vf->h<vf->dmpi->h && y+h == vf->h) | 267 if(vf->priv->exp_y+vf->h<vf->dmpi->h && y+h == vf->h) { |
265 vf_next_draw_slice(vf, vf->dmpi->planes, vf->dmpi->stride, | 268 unsigned char *src2[MP_MAX_PLANES]; |
269 src2[0] = vf->dmpi->planes[0] | |
270 + (vf->priv->exp_y+vf->h)*vf->dmpi->stride[0]; | |
271 if(vf->dmpi->flags&MP_IMGFLAG_PLANAR){ | |
272 src2[1] = vf->dmpi->planes[1] | |
273 + ((vf->priv->exp_y+vf->h)>>vf->dmpi->chroma_y_shift)*vf->dmpi->stride[1]; | |
274 src2[2] = vf->dmpi->planes[2] | |
275 + ((vf->priv->exp_y+vf->h)>>vf->dmpi->chroma_y_shift)*vf->dmpi->stride[2]; | |
276 } else { | |
277 src2[1] = vf->dmpi->planes[1]; // passthrough rgb8 palette | |
278 } | |
279 | |
280 vf_next_draw_slice(vf, src2, vf->dmpi->stride, | |
266 vf->dmpi->w,vf->dmpi->h-(vf->priv->exp_y+vf->h), | 281 vf->dmpi->w,vf->dmpi->h-(vf->priv->exp_y+vf->h), |
267 0,vf->priv->exp_y+vf->h); | 282 0,vf->priv->exp_y+vf->h); |
283 } | |
268 } | 284 } |
269 | 285 |
270 static int put_image(struct vf_instance_s* vf, mp_image_t *mpi){ | 286 static int put_image(struct vf_instance_s* vf, mp_image_t *mpi){ |
271 if(mpi->flags&MP_IMGFLAG_DIRECT || mpi->flags&MP_IMGFLAG_DRAW_CALLBACK){ | 287 if(mpi->flags&MP_IMGFLAG_DIRECT || mpi->flags&MP_IMGFLAG_DRAW_CALLBACK){ |
272 vf->dmpi=mpi->priv; | 288 vf->dmpi=mpi->priv; |