summaryrefslogtreecommitdiff
path: root/libavcodec/mpeg12.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-10-23 01:49:32 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-10-23 05:13:56 +0200
commitf97faf67510d92c2a18180a6ec80435d5dd1da0b (patch)
treeb63cb9b8a5fc5bafa6963c07c712dbbdf419a175 /libavcodec/mpeg12.c
parent9e8dff90efa3faae5ac07fa5fae7e154367e24fd (diff)
parente71ebb19722bd2b46831d0ec311b757a56340617 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: id3v2: fix doxy comment - 'machine byte order' makes no sense on char arrays VC1: restore mistakenly removed code twinvq: check output buffer size before decoding twinvq: return an error when the packet size is too small lavf: export some forgotten symbols with non-av prefixes. swscale: update altivec yuv2planeX asm to new per-plane API. swscale: make yuv2yuvX_10_sse2/avx 8/9/16-bits aware. yuv2planeX10 SIMD swscale: decide whether to use yuv2plane1/X on a per-plane basis. swscale: reintroduce full precision in 16-bit output. Split up yuv2yuvX functions Split out yuv2yuv1 luma and chroma in order to make them generic DSP functions lavc: replace references to deprecated AVCodecContext.error_recognition to use AVCodecContext.err_recognition lavc: translate non-flag-based er options into flag-based ef options at codec open add -err_filter AVOptions to access flag-based error recognition h264_weight: initialize "height" function argument properly. presets: spelling error in libvpx 1080p50_60 avplay: fix fullscreen behaviour with SDL 1.2.14 on Mac OS X Conflicts: ffplay.c libavformat/libavformat.v libswscale/swscale.c libswscale/x86/swscale_template.c tests/ref/lavfi/pixfmts_scale Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpeg12.c')
-rw-r--r--libavcodec/mpeg12.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index 9663db2f61..7d469530d0 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -1378,7 +1378,7 @@ static int mpeg1_decode_picture(AVCodecContext *avctx,
if (s->pict_type == AV_PICTURE_TYPE_P || s->pict_type == AV_PICTURE_TYPE_B) {
s->full_pel[0] = get_bits1(&s->gb);
f_code = get_bits(&s->gb, 3);
- if (f_code == 0 && avctx->error_recognition >= FF_ER_COMPLIANT)
+ if (f_code == 0 && (avctx->err_recognition & AV_EF_BITSTREAM))
return -1;
s->mpeg_f_code[0][0] = f_code;
s->mpeg_f_code[0][1] = f_code;
@@ -1386,7 +1386,7 @@ static int mpeg1_decode_picture(AVCodecContext *avctx,
if (s->pict_type == AV_PICTURE_TYPE_B) {
s->full_pel[1] = get_bits1(&s->gb);
f_code = get_bits(&s->gb, 3);
- if (f_code == 0 && avctx->error_recognition >= FF_ER_COMPLIANT)
+ if (f_code == 0 && (avctx->err_recognition & AV_EF_BITSTREAM))
return -1;
s->mpeg_f_code[1][0] = f_code;
s->mpeg_f_code[1][1] = f_code;
@@ -1819,7 +1819,7 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y,
&& s->progressive_frame == 0 /* vbv_delay == 0xBBB || 0xE10*/;
if (left < 0 || (left && show_bits(&s->gb, FFMIN(left, 23)) && !is_d10)
- || (avctx->error_recognition >= FF_ER_AGGRESSIVE && left > 8)) {
+ || ((avctx->err_recognition & AV_EF_BUFFER) && left > 8)) {
av_log(avctx, AV_LOG_ERROR, "end mismatch left=%d %0X\n", left, show_bits(&s->gb, FFMIN(left, 23)));
return -1;
} else
@@ -1911,7 +1911,7 @@ static int slice_decode_thread(AVCodecContext *c, void *arg)
//av_log(c, AV_LOG_DEBUG, "ret:%d resync:%d/%d mb:%d/%d ts:%d/%d ec:%d\n",
//ret, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, s->start_mb_y, s->end_mb_y, s->error_count);
if (ret < 0) {
- if (c->error_recognition >= FF_ER_EXPLODE)
+ if (c->err_recognition & AV_EF_EXPLODE)
return ret;
if (s->resync_mb_x >= 0 && s->resync_mb_y >= 0)
ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, AC_ERROR | DC_ERROR | MV_ERROR);
@@ -1999,7 +1999,7 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx,
s->aspect_ratio_info = get_bits(&s->gb, 4);
if (s->aspect_ratio_info == 0) {
av_log(avctx, AV_LOG_ERROR, "aspect ratio has forbidden 0 value\n");
- if (avctx->error_recognition >= FF_ER_COMPLIANT)
+ if (avctx->err_recognition & AV_EF_BITSTREAM)
return -1;
}
s->frame_rate_index = get_bits(&s->gb, 4);
@@ -2287,7 +2287,7 @@ static int mpeg_decode_frame(AVCodecContext *avctx,
if (avctx->extradata && !avctx->frame_number) {
int ret = decode_chunks(avctx, picture, data_size, avctx->extradata, avctx->extradata_size);
- if (ret < 0 && avctx->error_recognition >= FF_ER_EXPLODE)
+ if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
return ret;
}
@@ -2347,7 +2347,7 @@ static int decode_chunks(AVCodecContext *avctx,
s->sync=1;
} else {
av_log(avctx, AV_LOG_ERROR, "ignoring SEQ_START_CODE after %X\n", last_code);
- if (avctx->error_recognition >= FF_ER_EXPLODE)
+ if (avctx->err_recognition & AV_EF_EXPLODE)
return AVERROR_INVALIDDATA;
}
break;
@@ -2381,7 +2381,7 @@ static int decode_chunks(AVCodecContext *avctx,
last_code = PICTURE_START_CODE;
} else {
av_log(avctx, AV_LOG_ERROR, "ignoring pic after %X\n", last_code);
- if (avctx->error_recognition >= FF_ER_EXPLODE)
+ if (avctx->err_recognition & AV_EF_EXPLODE)
return AVERROR_INVALIDDATA;
}
break;
@@ -2394,7 +2394,7 @@ static int decode_chunks(AVCodecContext *avctx,
mpeg_decode_sequence_extension(s);
} else {
av_log(avctx, AV_LOG_ERROR, "ignoring seq ext after %X\n", last_code);
- if (avctx->error_recognition >= FF_ER_EXPLODE)
+ if (avctx->err_recognition & AV_EF_EXPLODE)
return AVERROR_INVALIDDATA;
}
break;
@@ -2412,7 +2412,7 @@ static int decode_chunks(AVCodecContext *avctx,
mpeg_decode_picture_coding_extension(s);
} else {
av_log(avctx, AV_LOG_ERROR, "ignoring pic cod ext after %X\n", last_code);
- if (avctx->error_recognition >= FF_ER_EXPLODE)
+ if (avctx->err_recognition & AV_EF_EXPLODE)
return AVERROR_INVALIDDATA;
}
break;
@@ -2428,7 +2428,7 @@ static int decode_chunks(AVCodecContext *avctx,
s->sync=1;
} else {
av_log(avctx, AV_LOG_ERROR, "ignoring GOP_START_CODE after %X\n", last_code);
- if (avctx->error_recognition >= FF_ER_EXPLODE)
+ if (avctx->err_recognition & AV_EF_EXPLODE)
return AVERROR_INVALIDDATA;
}
break;
@@ -2475,7 +2475,7 @@ static int decode_chunks(AVCodecContext *avctx,
if (!s2->pict_type) {
av_log(avctx, AV_LOG_ERROR, "Missing picture start code\n");
- if (avctx->error_recognition >= FF_ER_EXPLODE)
+ if (avctx->err_recognition & AV_EF_EXPLODE)
return AVERROR_INVALIDDATA;
break;
}
@@ -2516,7 +2516,7 @@ static int decode_chunks(AVCodecContext *avctx,
emms_c();
if (ret < 0) {
- if (avctx->error_recognition >= FF_ER_EXPLODE)
+ if (avctx->err_recognition & AV_EF_EXPLODE)
return ret;
if (s2->resync_mb_x >= 0 && s2->resync_mb_y >= 0)
ff_er_add_slice(s2, s2->resync_mb_x, s2->resync_mb_y, s2->mb_x, s2->mb_y, AC_ERROR | DC_ERROR | MV_ERROR);