Commit db13c3e5 authored by reimar's avatar reimar

lcldec.c: change #if CONFIG_ZLIB to #if CONFIG_ZLIB_DECODER.

The zlib related code should not be compiled in when the decoder is disabled
and it thus will never be used, even if we have zlib available.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19035 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 70be77e0
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#include "get_bits.h" #include "get_bits.h"
#include "lcl.h" #include "lcl.h"
#if CONFIG_ZLIB #if CONFIG_ZLIB_DECODER
#include <zlib.h> #include <zlib.h>
#endif #endif
...@@ -65,7 +65,7 @@ typedef struct LclDecContext { ...@@ -65,7 +65,7 @@ typedef struct LclDecContext {
unsigned int decomp_size; unsigned int decomp_size;
// Decompression buffer // Decompression buffer
unsigned char* decomp_buf; unsigned char* decomp_buf;
#if CONFIG_ZLIB #if CONFIG_ZLIB_DECODER
z_stream zstream; z_stream zstream;
#endif #endif
} LclDecContext; } LclDecContext;
...@@ -137,7 +137,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac ...@@ -137,7 +137,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
unsigned char yq, y1q, uq, vq; unsigned char yq, y1q, uq, vq;
int uqvq; int uqvq;
unsigned int mthread_inlen, mthread_outlen; unsigned int mthread_inlen, mthread_outlen;
#if CONFIG_ZLIB #if CONFIG_ZLIB_DECODER
int zret; // Zlib return code int zret; // Zlib return code
#endif #endif
unsigned int len = buf_size; unsigned int len = buf_size;
...@@ -198,7 +198,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac ...@@ -198,7 +198,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
} }
break; break;
case CODEC_ID_ZLIB: case CODEC_ID_ZLIB:
#if CONFIG_ZLIB #if CONFIG_ZLIB_DECODER
/* Using the original dll with normal compression (-1) and RGB format /* Using the original dll with normal compression (-1) and RGB format
* gives a file with ZLIB fourcc, but frame is really uncompressed. * gives a file with ZLIB fourcc, but frame is really uncompressed.
* To be sure that's true check also frame size */ * To be sure that's true check also frame size */
...@@ -470,7 +470,7 @@ static av_cold int decode_init(AVCodecContext *avctx) ...@@ -470,7 +470,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
c->pic.data[0] = NULL; c->pic.data[0] = NULL;
#if CONFIG_ZLIB #if CONFIG_ZLIB_DECODER
// Needed if zlib unused or init aborted before inflateInit // Needed if zlib unused or init aborted before inflateInit
memset(&c->zstream, 0, sizeof(z_stream)); memset(&c->zstream, 0, sizeof(z_stream));
#endif #endif
...@@ -551,7 +551,7 @@ static av_cold int decode_init(AVCodecContext *avctx) ...@@ -551,7 +551,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
} }
break; break;
case CODEC_ID_ZLIB: case CODEC_ID_ZLIB:
#if CONFIG_ZLIB #if CONFIG_ZLIB_DECODER
switch (c->compression) { switch (c->compression) {
case COMP_ZLIB_HISPEED: case COMP_ZLIB_HISPEED:
av_log(avctx, AV_LOG_INFO, "High speed compression.\n"); av_log(avctx, AV_LOG_INFO, "High speed compression.\n");
...@@ -600,7 +600,7 @@ static av_cold int decode_init(AVCodecContext *avctx) ...@@ -600,7 +600,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
/* If needed init zlib */ /* If needed init zlib */
if (avctx->codec_id == CODEC_ID_ZLIB) { if (avctx->codec_id == CODEC_ID_ZLIB) {
#if CONFIG_ZLIB #if CONFIG_ZLIB_DECODER
c->zstream.zalloc = Z_NULL; c->zstream.zalloc = Z_NULL;
c->zstream.zfree = Z_NULL; c->zstream.zfree = Z_NULL;
c->zstream.opaque = Z_NULL; c->zstream.opaque = Z_NULL;
...@@ -629,7 +629,7 @@ static av_cold int decode_end(AVCodecContext *avctx) ...@@ -629,7 +629,7 @@ static av_cold int decode_end(AVCodecContext *avctx)
if (c->pic.data[0]) if (c->pic.data[0])
avctx->release_buffer(avctx, &c->pic); avctx->release_buffer(avctx, &c->pic);
#if CONFIG_ZLIB #if CONFIG_ZLIB_DECODER
inflateEnd(&c->zstream); inflateEnd(&c->zstream);
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment