summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vf_scale.c
diff options
context:
space:
mode:
authorrfelker <rfelker@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-05-20 17:42:33 +0000
committerrfelker <rfelker@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-05-20 17:42:33 +0000
commit8b0fe128407b9d0bfcb32d58c57a3f78d5a180cb (patch)
treee8e03445914fca8b44454c5c54ee828fedc3b156 /libmpcodecs/vf_scale.c
parentb7fc25cc94ab79c4c225aeb028e12b83f3c3ef4e (diff)
downloadmpv-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_scale.c')
-rw-r--r--libmpcodecs/vf_scale.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libmpcodecs/vf_scale.c b/libmpcodecs/vf_scale.c
index f478e25d44..92a8ab9c25 100644
--- a/libmpcodecs/vf_scale.c
+++ b/libmpcodecs/vf_scale.c
@@ -24,7 +24,6 @@ static struct vf_priv_s {
unsigned int fmt;
struct SwsContext *ctx;
unsigned char* palette;
- mp_image_t *dmpi;
} vf_priv_dflt = {
-1,-1,
0,
@@ -228,7 +227,7 @@ static void start_slice(struct vf_instance_s* vf, mp_image_t *mpi){
// printf("start_slice called! flag=%d\n",mpi->flags&MP_IMGFLAG_DRAW_CALLBACK);
if(!(mpi->flags&MP_IMGFLAG_DRAW_CALLBACK)) return; // shouldn't happen
// they want slices!!! allocate the buffer.
- mpi->priv=vf->priv->dmpi=vf_get_image(vf->next,vf->priv->fmt,
+ mpi->priv=vf->dmpi=vf_get_image(vf->next,vf->priv->fmt,
// mpi->type, mpi->flags & (~MP_IMGFLAG_DRAW_CALLBACK),
MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_PREFER_ALIGNED_STRIDE,
vf->priv->w, vf->priv->h);
@@ -236,7 +235,7 @@ static void start_slice(struct vf_instance_s* vf, mp_image_t *mpi){
static void draw_slice(struct vf_instance_s* vf,
unsigned char** src, int* stride, int w,int h, int x, int y){
- mp_image_t *dmpi=vf->priv->dmpi;
+ mp_image_t *dmpi=vf->dmpi;
if(!dmpi){
mp_msg(MSGT_VFILTER,MSGL_FATAL,"vf_scale: draw_slice() called with dmpi=NULL (no get_image??)\n");
return;