summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vf.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-12-26 11:51:19 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-12-26 11:51:19 +0000
commitafc5a627d85cec556e7fca13fc5a03e5c4452850 (patch)
treee865cca32e1c14512cccb11f4f15f90bbd31ff32 /libmpcodecs/vf.c
parentbd06a94738d902bbac42c4573ba8640463423b8e (diff)
downloadmpv-afc5a627d85cec556e7fca13fc5a03e5c4452850.tar.bz2
mpv-afc5a627d85cec556e7fca13fc5a03e5c4452850.tar.xz
Support mp_image with allocated palette.
Fixes playback and a memory leak for FFmpeg codecs which use reget_buffer with paletted data, e.g. cdgraphics. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30116 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/vf.c')
-rw-r--r--libmpcodecs/vf.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libmpcodecs/vf.c b/libmpcodecs/vf.c
index 6192ffda20..c2d50b870d 100644
--- a/libmpcodecs/vf.c
+++ b/libmpcodecs/vf.c
@@ -322,8 +322,8 @@ mp_image_t* vf_get_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype,
// keep buffer allocation status & color flags only:
// mpi->flags&=~(MP_IMGFLAG_PRESERVE|MP_IMGFLAG_READABLE|MP_IMGFLAG_DIRECT);
mpi->flags&=MP_IMGFLAG_ALLOCATED|MP_IMGFLAG_TYPE_DISPLAYED|MP_IMGFLAGMASK_COLORS;
- // accept restrictions & draw_slice flags only:
- mpi->flags|=mp_imgflag&(MP_IMGFLAGMASK_RESTRICTIONS|MP_IMGFLAG_DRAW_CALLBACK);
+ // accept restrictions, draw_slice and palette flags only:
+ mpi->flags|=mp_imgflag&(MP_IMGFLAGMASK_RESTRICTIONS|MP_IMGFLAG_DRAW_CALLBACK|MP_IMGFLAG_RGB_PALETTE);
if(!vf->draw_slice) mpi->flags&=~MP_IMGFLAG_DRAW_CALLBACK;
if(mpi->width!=w2 || mpi->height!=h){
// printf("vf.c: MPI parameters changed! %dx%d -> %dx%d \n", mpi->width,mpi->height,w2,h);
@@ -406,6 +406,8 @@ 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;
+ if (mpi->flags & MP_IMGFLAG_RGB_PALETTE)
+ mpi->planes[1] = memalign(64, 1024);
}
// printf("clearing img!\n");
vf_mpi_clear(mpi,0,0,mpi->width,mpi->height);