[MPlayer-dev-eng] [PATCH] another autoload palette patch

Joey Parrish joey at nicewarrior.org
Mon Feb 3 23:48:55 CET 2003


Hello,

Attached below is yet another patch to autoload palette filter.
Hopefully, I did this right.  From what little testing I have
been able to do, it seems to be okay, and the logic looks solid
enough to me.  Someone please help me test this patch.

Also attached is a quick fix for a small buf in vf_expand.  With this
second patch, vf_expand will passthrough the palette.  Without this
patch, playing gifs with autoload palette and jpeg vo was resulting in
grayscale output due to lack of palette info in vf_palette.

Thanks,
--Joey
-------------- next part --------------
diff -Nur main.cvs/libmpcodecs/vd.c main.dev/libmpcodecs/vd.c
--- main.cvs/libmpcodecs/vd.c	Fri Dec 27 11:31:52 2002
+++ main.dev/libmpcodecs/vd.c	Mon Feb  3 16:03:56 2003
@@ -191,7 +191,12 @@
     }
     if(j<0){
 	// TODO: no match - we should use conversion...
-	if(strcmp(vf->info->name,"scale")){	
+	if((preferred_outfmt==IMGFMT_RGB8||preferred_outfmt==IMGFMT_BGR8)&&
+	  strcmp(vf->info->name,"palette")&&strcmp(vf->info->name,"scale")){
+	    mp_msg(MSGT_DECVIDEO,MSGL_INFO,MSGTR_CouldNotFindColorspace);
+	    vf=vf_open_filter(vf,"palette",NULL);
+	    goto csp_again;
+	} else if(strcmp(vf->info->name,"scale")){
 	    mp_msg(MSGT_DECVIDEO,MSGL_INFO,MSGTR_CouldNotFindColorspace);
 	    sc=vf=vf_open_filter(vf,"scale",NULL);
 	    goto csp_again;
-------------- next part --------------
diff -Nur main.cvs/libmpcodecs/vf_expand.c main.dev/libmpcodecs/vf_expand.c
--- main.cvs/libmpcodecs/vf_expand.c	Sun Jan 12 22:31:33 2003
+++ main.dev/libmpcodecs/vf_expand.c	Mon Feb  3 15:47:01 2003
@@ -255,6 +255,7 @@
 	        vf->priv->exp_y*vf->priv->dmpi->stride[0]+vf->priv->exp_x*(vf->priv->dmpi->bpp/8),
 		mpi->planes[0], mpi->w*(vf->priv->dmpi->bpp/8), mpi->h,
 		vf->priv->dmpi->stride[0],mpi->stride[0]);
+	vf->priv->dmpi->planes[1] = mpi->planes[1]; // passthrough rgb8 palette
     }
 #ifdef OSD_SUPPORT
     if(vf->priv->osd) draw_osd(vf,mpi->w,mpi->h);


More information about the MPlayer-dev-eng mailing list