# HG changeset patch # User reimar # Date 1243761561 0 # Node ID f52c5d54ede5f7ce8ecb605d18ca225be83f6941 # Parent 705efd6ddaab778cc37dedbdecbdd457e8d8e9c2 Get rid of unreachable code: avctx->codec_id == CODEC_ID_ZLIB is not possible here when the zlib decoder is disabled and libavcodec is used correctly. diff -r 705efd6ddaab -r f52c5d54ede5 lcldec.c --- a/lcldec.c Sun May 31 09:16:06 2009 +0000 +++ b/lcldec.c Sun May 31 09:19:21 2009 +0000 @@ -197,8 +197,8 @@ return -1; } break; +#if CONFIG_ZLIB_DECODER case CODEC_ID_ZLIB: -#if CONFIG_ZLIB_DECODER /* Using the original dll with normal compression (-1) and RGB format * gives a file with ZLIB fourcc, but frame is really uncompressed. * To be sure that's true check also frame size */ @@ -266,11 +266,8 @@ } encoded = c->decomp_buf; len = c->decomp_size; -#else - av_log(avctx, AV_LOG_ERROR, "BUG! Zlib support not compiled in frame decoder.\n"); - return -1; + break; #endif - break; default: av_log(avctx, AV_LOG_ERROR, "BUG! Unknown codec in frame decoder compression switch.\n"); return -1; @@ -550,8 +547,8 @@ return 1; } break; +#if CONFIG_ZLIB_DECODER case CODEC_ID_ZLIB: -#if CONFIG_ZLIB_DECODER switch (c->compression) { case COMP_ZLIB_HISPEED: av_log(avctx, AV_LOG_INFO, "High speed compression.\n"); @@ -569,11 +566,8 @@ } av_log(avctx, AV_LOG_INFO, "Compression level for ZLIB: (%d).\n", c->compression); } -#else - av_log(avctx, AV_LOG_ERROR, "Zlib support not compiled.\n"); - return 1; + break; #endif - break; default: av_log(avctx, AV_LOG_ERROR, "BUG! Unknown codec in compression switch.\n"); return 1; @@ -599,8 +593,8 @@ av_log(avctx, AV_LOG_ERROR, "Unknown flag set (%d).\n", c->flags); /* If needed init zlib */ +#if CONFIG_ZLIB_DECODER if (avctx->codec_id == CODEC_ID_ZLIB) { -#if CONFIG_ZLIB_DECODER c->zstream.zalloc = Z_NULL; c->zstream.zfree = Z_NULL; c->zstream.opaque = Z_NULL; @@ -609,11 +603,8 @@ av_log(avctx, AV_LOG_ERROR, "Inflate init error: %d\n", zret); return 1; } -#else - av_log(avctx, AV_LOG_ERROR, "Zlib support not compiled.\n"); - return 1; + } #endif - } return 0; }