diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-12-29 02:57:49 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-12-29 02:57:49 +0000 |
commit | 06e049b7ce1d7e1060afba4add2bb7c0207aea98 (patch) | |
tree | 5853a0a8753c3ec8e7eac5f945c4fd4242818dd0 /libmpcodecs/vf.c | |
parent | 9e0d37a9b97090926f311ac7ac512cedc1887379 (diff) | |
download | mpv-06e049b7ce1d7e1060afba4add2bb7c0207aea98.tar.bz2 mpv-06e049b7ce1d7e1060afba4add2bb7c0207aea98.tar.xz |
(temporary?) fix for redundant buffer re-allocation
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8632 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/vf.c')
-rw-r--r-- | libmpcodecs/vf.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/libmpcodecs/vf.c b/libmpcodecs/vf.c index 3001eae288..a4abda646d 100644 --- a/libmpcodecs/vf.c +++ b/libmpcodecs/vf.c @@ -184,13 +184,18 @@ mp_image_t* vf_get_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype, // accept restrictions & draw_slice flags only: mpi->flags|=mp_imgflag&(MP_IMGFLAGMASK_RESTRICTIONS|MP_IMGFLAG_DRAW_CALLBACK); if(!vf->draw_slice) mpi->flags&=~MP_IMGFLAG_DRAW_CALLBACK; - if((mpi->width!=w2 || mpi->height!=h) && !(mpi->flags&MP_IMGFLAG_DIRECT)){ - mpi->width=w2; mpi->chroma_width=w2>>mpi->chroma_x_shift; - mpi->height=h; mpi->chroma_height=h>>mpi->chroma_y_shift; + if(mpi->width!=w2 || mpi->height!=h){ +// printf("vf.c: MPI parameters changed! %dx%d -> %dx%d \n", mpi->width,mpi->height,w2,h); if(mpi->flags&MP_IMGFLAG_ALLOCATED){ - // need to re-allocate buffer memory: - free(mpi->planes[0]); - mpi->flags&=~MP_IMGFLAG_ALLOCATED; + if(mpi->width<w2 || mpi->height<h){ + // need to re-allocate buffer memory: + free(mpi->planes[0]); + mpi->flags&=~MP_IMGFLAG_ALLOCATED; + printf("vf.c: have to REALLOCATE buffer memory :(\n"); + } + } else { + mpi->width=w2; mpi->chroma_width=w2>>mpi->chroma_x_shift; + mpi->height=h; mpi->chroma_height=h>>mpi->chroma_y_shift; } } if(!mpi->bpp) mp_image_setfmt(mpi,outfmt); @@ -246,6 +251,7 @@ mp_image_t* vf_get_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype, } else { if(!mpi->stride[0]) mpi->stride[0]=mpi->width*mpi->bpp/8; } +// printf("clearing img!\n"); vf_mpi_clear(mpi,0,0,mpi->width,mpi->height); mpi->flags|=MP_IMGFLAG_ALLOCATED; } @@ -267,6 +273,9 @@ mp_image_t* vf_get_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype, } } +// printf("\rVF_MPI: %p %p %p %d %d %d \n", +// mpi->planes[0],mpi->planes[1],mpi->planes[2], +// mpi->stride[0],mpi->stride[1],mpi->stride[2]); return mpi; } |