1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

Merge commit '1a31dff9370b4732c91df5cb1ca4b39f2cb3050e'

* commit '1a31dff9370b4732c91df5cb1ca4b39f2cb3050e':
  loco: return meaningful error codes.
  flicvideo: return meaningful error codes.
  vcr1: remove disabled encoder stub

Conflicts:
	libavcodec/flicvideo.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-01-14 15:36:35 +01:00
commit f9d5bdd0f6
3 changed files with 6 additions and 45 deletions

View File

@ -787,7 +787,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 AVERROR_INVALIDDATA;
return AVERROR_BUG;
}

View File

@ -168,15 +168,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;
@ -245,7 +245,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) {
@ -276,7 +276,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);

View File

@ -159,42 +159,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 */