diff options
author | rfelker <rfelker@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-05-20 17:42:33 +0000 |
---|---|---|
committer | rfelker <rfelker@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-05-20 17:42:33 +0000 |
commit | 8b0fe128407b9d0bfcb32d58c57a3f78d5a180cb (patch) | |
tree | e8e03445914fca8b44454c5c54ee828fedc3b156 /libmpcodecs/vf.c | |
parent | b7fc25cc94ab79c4c225aeb028e12b83f3c3ef4e (diff) | |
download | mpv-8b0fe128407b9d0bfcb32d58c57a3f78d5a180cb.tar.bz2 mpv-8b0fe128407b9d0bfcb32d58c57a3f78d5a180cb.tar.xz |
fix segfaults with slices. support slice rendering into a filter even
when the following filter/vo doesn't support slices. also use unified
vf->dmpi rather than having vf->priv->dmpi duplicated in every filter.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10141 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/vf.c')
-rw-r--r-- | libmpcodecs/vf.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/libmpcodecs/vf.c b/libmpcodecs/vf.c index 854b0faf47..836b521169 100644 --- a/libmpcodecs/vf.c +++ b/libmpcodecs/vf.c @@ -17,6 +17,8 @@ #include "mp_image.h" #include "vf.h" +#include "../libvo/fastmemcpy.h" + extern vf_info_t vf_info_vo; extern vf_info_t vf_info_rectangle; #ifndef HAVE_NO_POSIX_SELECT @@ -479,7 +481,25 @@ int vf_next_put_image(struct vf_instance_s* vf,mp_image_t *mpi){ } void vf_next_draw_slice(struct vf_instance_s* vf,unsigned char** src, int * stride,int w, int h, int x, int y){ - vf->next->draw_slice(vf->next,src,stride,w,h,x,y); + if (vf->next->draw_slice) { + vf->next->draw_slice(vf->next,src,stride,w,h,x,y); + return; + } + if (!vf->dmpi) { + mp_msg(MSGT_VFILTER,MSGL_ERR,"draw_slice: dmpi not stored by vf_%s\n", vf->info->name); + return; + } + if (!(vf->dmpi->flags & MP_IMGFLAG_PLANAR)) { + memcpy_pic(vf->dmpi->planes[0]+y*vf->dmpi->stride[0]+vf->dmpi->bpp/8*x, + src[0], vf->dmpi->bpp/8*w, h, vf->dmpi->stride[0], stride); + return; + } + memcpy_pic(vf->dmpi->planes[0]+y*vf->dmpi->stride[0]+x, src[0], + w, h, vf->dmpi->stride[0], stride[0]); + memcpy_pic(vf->dmpi->planes[1]+(y>>vf->dmpi->chroma_y_shift)*vf->dmpi->stride[1]+(x>>vf->dmpi->chroma_x_shift), + src[1], w>>vf->dmpi->chroma_x_shift, h>>vf->dmpi->chroma_y_shift, vf->dmpi->stride[1], stride[1]); + memcpy_pic(vf->dmpi->planes[2]+(y>>vf->dmpi->chroma_y_shift)*vf->dmpi->stride[2]+(x>>vf->dmpi->chroma_x_shift), + src[2], w>>vf->dmpi->chroma_x_shift, h>>vf->dmpi->chroma_y_shift, vf->dmpi->stride[2], stride[2]); } //============================================================================ |