summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorrtognimp <rtognimp@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-11-24 20:03:10 +0000
committerrtognimp <rtognimp@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-11-24 20:03:10 +0000
commitc5c3337c5991b7df2a744d844aef520b7bedf2ab (patch)
tree8ec566962762a69159aaf8bc47cf61f68c008881 /libmpcodecs
parentfed551e1129e4ad986ed09f3498b9edf01f61b5d (diff)
downloadmpv-c5c3337c5991b7df2a744d844aef520b7bedf2ab.tar.bz2
mpv-c5c3337c5991b7df2a744d844aef520b7bedf2ab.tar.xz
Support arbitrary compression level in ZLIB.
Fix some debug mp_msg type sizes. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11517 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/vd_lcl.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/libmpcodecs/vd_lcl.c b/libmpcodecs/vd_lcl.c
index 834a77eb7c..7bb9dce3c0 100644
--- a/libmpcodecs/vd_lcl.c
+++ b/libmpcodecs/vd_lcl.c
@@ -219,8 +219,11 @@ static int init(sh_video_t *sh)
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 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags)
}
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 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags)
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 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags)
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 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags)
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 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags)
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");