diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-14 15:45:05 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-01-14 15:45:05 +0100 |
commit | 92b238715929a26d77e99a18fe5996bcb5796149 (patch) | |
tree | ea683bd86b4609f3aa5386980cb5c5f24d426799 /libavcodec/tscc.c | |
parent | f9d5bdd0f6526e852ec37528c9b5f97beb71ef07 (diff) | |
parent | df9036830b15997a3e9c3f2c632ed98d64f9deef (diff) | |
download | ffmpeg-92b238715929a26d77e99a18fe5996bcb5796149.tar.gz |
Merge commit 'df9036830b15997a3e9c3f2c632ed98d64f9deef'
* commit 'df9036830b15997a3e9c3f2c632ed98d64f9deef':
truemotion2: return meaningful error codes.
tscc: remove some pointless comments and empty lines.
tscc: return meaningful error codes.
loco: cosmetics, reformat
Conflicts:
libavcodec/truemotion2.c
libavcodec/tscc.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/tscc.c')
-rw-r--r-- | libavcodec/tscc.c | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/libavcodec/tscc.c b/libavcodec/tscc.c index 2aca0ba3b0..7c2d2319bb 100644 --- a/libavcodec/tscc.c +++ b/libavcodec/tscc.c @@ -44,10 +44,6 @@ #include <zlib.h> - -/* - * Decoder context - */ typedef struct TsccContext { AVCodecContext *avctx; @@ -66,11 +62,6 @@ typedef struct TsccContext { uint32_t pal[256]; } CamtasiaContext; -/* - * - * Decode a frame - * - */ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { @@ -83,7 +74,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, c->pic.reference = 3; c->pic.buffer_hints = FF_BUFFER_HINTS_VALID; - if((ret = avctx->reget_buffer(avctx, &c->pic)) < 0){ + if ((ret = avctx->reget_buffer(avctx, &c->pic)) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; } @@ -91,7 +82,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, zret = inflateReset(&c->zstream); if (zret != Z_OK) { av_log(avctx, AV_LOG_ERROR, "Inflate reset error: %d\n", zret); - return AVERROR(EINVAL); + return AVERROR_UNKNOWN; } c->zstream.next_in = (uint8_t*)encoded; c->zstream.avail_in = len; @@ -101,7 +92,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, // Z_DATA_ERROR means empty picture if ((zret != Z_OK) && (zret != Z_STREAM_END) && (zret != Z_DATA_ERROR)) { av_log(avctx, AV_LOG_ERROR, "Inflate error: %d\n", zret); - return AVERROR(EINVAL); + return AVERROR_UNKNOWN; } @@ -129,13 +120,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, return buf_size; } - - -/* - * - * Init tscc decoder - * - */ static av_cold int decode_init(AVCodecContext *avctx) { CamtasiaContext * const c = avctx->priv_data; @@ -176,19 +160,12 @@ static av_cold int decode_init(AVCodecContext *avctx) zret = inflateInit(&c->zstream); if (zret != Z_OK) { av_log(avctx, AV_LOG_ERROR, "Inflate init error: %d\n", zret); - return AVERROR(ENOMEM); + return AVERROR_UNKNOWN; } return 0; } - - -/* - * - * Uninit tscc decoder - * - */ static av_cold int decode_end(AVCodecContext *avctx) { CamtasiaContext * const c = avctx->priv_data; |