[Mplayer-cvslog] CVS: main/libmpcodecs vd_lcl.c,1.4,1.5

Roberto Togni CVS rtognimp at mplayerhq.hu
Mon Nov 24 21:03:44 CET 2003


Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var/tmp.root/cvs-serv29892

Modified Files:
	vd_lcl.c 
Log Message:
Support arbitrary compression level in ZLIB.
Fix some debug mp_msg type sizes.


Index: vd_lcl.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd_lcl.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- vd_lcl.c	17 Jan 2003 21:44:58 -0000	1.4
+++ vd_lcl.c	24 Nov 2003 20:03:10 -0000	1.5
@@ -219,8 +219,11 @@
           mp_msg(MSGT_DECVIDEO, MSGL_INFO, "[LCL] Normal compression.\n");
           break;
         default:
-          mp_msg(MSGT_DECVIDEO, MSGL_ERR, "[LCL] Unsupported compression format for ZLIB (%d).\n", hc->compression);
-          return 0;
+          if ((hc->compression < Z_NO_COMPRESSION) || (hc->compression > Z_BEST_COMPRESSION)) {
+	    mp_msg(MSGT_DECVIDEO, MSGL_INFO, "[LCL] Unusupported compression level for ZLIB: (%d).\n", hc->compression);
+	    return 0;
+	  }
+          mp_msg(MSGT_DECVIDEO, MSGL_INFO, "[LCL] Compression level for ZLIB: (%d).\n", hc->compression);
       }
       break;
     default:
@@ -407,10 +410,6 @@
       }
       break;
     case CODEC_ZLIB:
-      switch (hc->compression) {
-        case COMP_ZLIB_HISPEED:
-        case COMP_ZLIB_HICOMP:
-        case COMP_ZLIB_NORMAL:
 #ifdef HAVE_ZLIB
           zret = inflateReset(&(hc->zstream));
           if (zret != Z_OK) {
@@ -430,7 +429,7 @@
               return 0;
             }
             if (mthread_outlen != (unsigned int)(hc->zstream.total_out)) {
-              mp_msg(MSGT_DECVIDEO, MSGL_WARN, "[LCL] ZLIB: mthread1 decoded size differs (%d != %d)\n",
+              mp_msg(MSGT_DECVIDEO, MSGL_WARN, "[LCL] ZLIB: mthread1 decoded size differs (%u != %lu)\n",
                      mthread_outlen, hc->zstream.total_out);
             }
             zret = inflateReset(&(hc->zstream));
@@ -448,7 +447,7 @@
               return 0;
             }
             if ((hc->decomp_size - mthread_outlen) != (unsigned int)(hc->zstream.total_out)) {
-              mp_msg(MSGT_DECVIDEO, MSGL_WARN, "[LCL] ZLIB: mthread2 decoded size differs (%d != %d)\n",
+              mp_msg(MSGT_DECVIDEO, MSGL_WARN, "[LCL] ZLIB: mthread2 decoded size differs (%d != %lu)\n",
                      hc->decomp_size - mthread_outlen, hc->zstream.total_out);
             }
           } else {
@@ -462,7 +461,7 @@
               return 0;
             }
             if (hc->decomp_size != (unsigned int)(hc->zstream.total_out)) {
-              mp_msg(MSGT_DECVIDEO, MSGL_WARN, "[LCL] ZLIB: decoded size differs (%d != %d)\n",
+              mp_msg(MSGT_DECVIDEO, MSGL_WARN, "[LCL] ZLIB: decoded size differs (%d != %lu)\n",
                      hc->decomp_size, hc->zstream.total_out);
             }
           }
@@ -472,11 +471,6 @@
           mp_msg(MSGT_DECVIDEO, MSGL_ERR, "[LCL] BUG! Zlib support not compiled in frame decoder.\n");
           return 0;
 #endif
-          break;
-        default:
-          mp_msg(MSGT_DECVIDEO, MSGL_ERR, "[LCL] BUG! Unknown ZLIB compression in frame decoder.\n");
-          return 0;
-      }
       break;
     default:
       mp_msg(MSGT_DECVIDEO, MSGL_ERR, "[LCL] BUG! Unknown codec in frame decoder compression switch.\n");



More information about the MPlayer-cvslog mailing list