From 6b3a1229bb30259332dd6e54a398c9c886012a67 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 19 Nov 2012 18:09:27 +0100 Subject: vcr1: remove disabled encoder stub --- libavcodec/vcr1.c | 39 --------------------------------------- 1 file changed, 39 deletions(-) (limited to 'libavcodec') diff --git a/libavcodec/vcr1.c b/libavcodec/vcr1.c index 2740c29437..d9514693c2 100644 --- a/libavcodec/vcr1.c +++ b/libavcodec/vcr1.c @@ -149,42 +149,3 @@ AVCodec ff_vcr1_decoder = { .capabilities = CODEC_CAP_DR1, .long_name = NULL_IF_CONFIG_SMALL("ATI VCR1"), }; - -/* Disable the encoder. */ -#undef CONFIG_VCR1_ENCODER -#define CONFIG_VCR1_ENCODER 0 - -#if CONFIG_VCR1_ENCODER - -#include "put_bits.h" - -static int vcr1_encode_frame(AVCodecContext *avctx, unsigned char *buf, - int buf_size, void *data) -{ - VCR1Context *const a = avctx->priv_data; - AVFrame *pict = data; - AVFrame *const p = &a->picture; - int size; - - *p = *pict; - p->pict_type = AV_PICTURE_TYPE_I; - p->key_frame = 1; - - avpriv_align_put_bits(&a->pb); - flush_put_bits(&a->pb); - - size = put_bits_count(&a->pb) / 32; - - return size * 4; -} - -AVCodec ff_vcr1_encoder = { - .name = "vcr1", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VCR1, - .priv_data_size = sizeof(VCR1Context), - .init = vcr1_common_init, - .encode = vcr1_encode_frame, - .long_name = NULL_IF_CONFIG_SMALL("ATI VCR1"), -}; -#endif /* CONFIG_VCR1_ENCODER */ -- cgit v1.2.3 From a9d970a019dfddf0f761d9ad1635a4451440458b Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 19 Nov 2012 18:24:27 +0100 Subject: flicvideo: return meaningful error codes. --- libavcodec/flicvideo.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'libavcodec') diff --git a/libavcodec/flicvideo.c b/libavcodec/flicvideo.c index d2cc6cdb41..f0b5d50d02 100644 --- a/libavcodec/flicvideo.c +++ b/libavcodec/flicvideo.c @@ -65,7 +65,7 @@ if (pixel_ptr + n > pixel_limit) { \ av_log (s->avctx, AV_LOG_INFO, "Problem: pixel_ptr >= pixel_limit (%d >= %d)\n", \ pixel_ptr + n, pixel_limit); \ - return -1; \ + return AVERROR_INVALIDDATA; \ } \ typedef struct FlicDecodeContext { @@ -116,10 +116,10 @@ static av_cold int flic_decode_init(AVCodecContext *avctx) case 16 : avctx->pix_fmt = AV_PIX_FMT_RGB565; break; case 24 : avctx->pix_fmt = AV_PIX_FMT_BGR24; /* Supposedly BGR, but havent any files to test with */ av_log(avctx, AV_LOG_ERROR, "24Bpp FLC/FLX is unsupported due to no test files.\n"); - return -1; + return AVERROR_PATCHWELCOME; default : av_log(avctx, AV_LOG_ERROR, "Unknown FLC/FLX depth of %d Bpp is unsupported.\n",depth); - return -1; + return AVERROR_INVALIDDATA; } s->frame.data[0] = NULL; @@ -147,7 +147,7 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx, unsigned int chunk_size; int chunk_type; - int i, j; + int i, j, ret; int color_packets; int color_changes; @@ -169,9 +169,9 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx, s->frame.reference = 1; s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE; - if (avctx->reget_buffer(avctx, &s->frame) < 0) { + if ((ret = avctx->reget_buffer(avctx, &s->frame)) < 0) { av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n"); - return -1; + return ret; } pixels = s->frame.data[0]; @@ -443,7 +443,7 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx, unsigned int chunk_size; int chunk_type; - int i, j; + int i, j, ret; int lines; int compressed_lines; @@ -460,9 +460,9 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx, s->frame.reference = 1; s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE; - if (avctx->reget_buffer(avctx, &s->frame) < 0) { + if ((ret = avctx->reget_buffer(avctx, &s->frame)) < 0) { av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n"); - return -1; + return ret; } pixels = s->frame.data[0]; @@ -692,7 +692,7 @@ static int flic_decode_frame_24BPP(AVCodecContext *avctx, const uint8_t *buf, int buf_size) { av_log(avctx, AV_LOG_ERROR, "24Bpp FLC Unsupported due to lack of test files.\n"); - return -1; + return AVERROR_PATCHWELCOME; } static int flic_decode_frame(AVCodecContext *avctx, @@ -720,7 +720,7 @@ static int flic_decode_frame(AVCodecContext *avctx, /* the finite set of possibilites allowable by here. */ /* But in case we do, just error out. */ av_log(avctx, AV_LOG_ERROR, "Unknown FLC format, my science cannot explain how this happened.\n"); - return -1; + return AVERROR_BUG; } -- cgit v1.2.3 From 1a31dff9370b4732c91df5cb1ca4b39f2cb3050e Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 19 Nov 2012 18:43:40 +0100 Subject: loco: return meaningful error codes. --- libavcodec/loco.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libavcodec') diff --git a/libavcodec/loco.c b/libavcodec/loco.c index 6f49992a61..e9ce482533 100644 --- a/libavcodec/loco.c +++ b/libavcodec/loco.c @@ -165,15 +165,15 @@ static int decode_frame(AVCodecContext *avctx, int buf_size = avpkt->size; LOCOContext * const l = avctx->priv_data; AVFrame * const p = &l->pic; - int decoded; + int decoded, ret; if(p->data[0]) avctx->release_buffer(avctx, p); p->reference = 0; - if(ff_get_buffer(avctx, p) < 0){ + if ((ret = ff_get_buffer(avctx, p)) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); - return -1; + return ret; } p->key_frame = 1; @@ -237,7 +237,7 @@ static av_cold int decode_init(AVCodecContext *avctx){ if (avctx->extradata_size < 12) { av_log(avctx, AV_LOG_ERROR, "Extradata size must be >= 12 instead of %i\n", avctx->extradata_size); - return -1; + return AVERROR_INVALIDDATA; } version = AV_RL32(avctx->extradata); switch(version) { @@ -268,7 +268,7 @@ static av_cold int decode_init(AVCodecContext *avctx){ break; default: av_log(avctx, AV_LOG_INFO, "Unknown colorspace, index = %i\n", l->mode); - return -1; + return AVERROR_INVALIDDATA; } if(avctx->debug & FF_DEBUG_PICT_INFO) av_log(avctx, AV_LOG_INFO, "lossy:%i, version:%i, mode: %i\n", l->lossy, version, l->mode); -- cgit v1.2.3