changeset 7789:17956aff04e1

bypass palette from bih, when codec cannot give it in o_bih
author arpi
date Sat, 19 Oct 2002 00:57:44 +0000
parents 25bf4f45639e
children 913e9b1f390f
files libmpcodecs/vd_vfw.c
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vd_vfw.c	Sat Oct 19 00:23:50 2002 +0000
+++ b/libmpcodecs/vd_vfw.c	Sat Oct 19 00:57:44 2002 +0000
@@ -240,11 +240,14 @@
     ICSendMessage(priv->handle, ICM_USER+80, (long)(&divx_quality), 0);
 
     // don't do this palette mess always, it makes div3 dll crashing...
-    if((sh->codec->outfmt[sh->outfmtidx]==IMGFMT_BGR8) &&
-       (!ICDecompressGetPalette(priv->handle, sh->bih, priv->o_bih)))
-    {
-	priv->palette = ((unsigned char*)priv->o_bih) + sh->bih->biSize;
-	mp_msg(MSGT_WIN32,MSGL_V,"ICDecompressGetPalette OK\n");
+    if(sh->codec->outfmt[sh->outfmtidx]==IMGFMT_BGR8){
+	if(ICDecompressGetPalette(priv->handle, sh->bih, priv->o_bih)){
+	    priv->palette = (unsigned char*)(priv->o_bih+1);
+	    mp_msg(MSGT_WIN32,MSGL_V,"ICDecompressGetPalette OK\n");
+	} else {
+	    if(sh->bih->biSize>=40+4*4)
+		priv->palette = (unsigned char*)(sh->bih+1);
+	}
     }
 
     mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: Win32 video codec init OK!\n");