changeset 11516:f686c2a2b64c

Support arbitrary compression level in ZLIB. Fix some debug mp_msg type sizes.
author rtognimp
date Mon, 24 Nov 2003 20:03:10 +0000
parents 138b6e1bc41b
children fe80bf7c849b
files libmpcodecs/vd_lcl.c
diffstat 1 files changed, 8 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vd_lcl.c	Mon Nov 24 19:56:35 2003 +0000
+++ b/libmpcodecs/vd_lcl.c	Mon Nov 24 20:03:10 2003 +0000
@@ -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");