summaryrefslogtreecommitdiffstats
path: root/libavcodec/mpeg12.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-09-05 22:10:26 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-09-05 22:29:16 +0200
commit3c54e7ed4f42d8ed5aece9484190b5294e272c36 (patch)
tree65e03151a2e17d9ac11aa76cc53b388a3185e3d6 /libavcodec/mpeg12.c
parent27bf599350a869877a1c9304abf9c95991692dd2 (diff)
parentae264bb29be3506a489347c6e27a04cded0de621 (diff)
downloadffmpeg-streaming-3c54e7ed4f42d8ed5aece9484190b5294e272c36.zip
ffmpeg-streaming-3c54e7ed4f42d8ed5aece9484190b5294e272c36.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: ac3enc: Add channel coupling support for the fixed-point AC-3 encoder. ac3enc: scale floating-point coupling channel coefficients in scale_coefficients() rather than in apply_channel_coupling() ac3enc: fix encoding of stereo ac3 files when rematrixing is disabled. wavpack: fix wrong return value in wavpack_decode_block() avconv: fix parsing metadata specifiers. fate: use +frame+slice named constants instead of '3' mpeg12: propagate more real return values through chunk decode error return and fix some indentation wavpack: use context reset in appropriate places avconv: move mux_preload and mux_max_delay to options context avconv: move bitstream filters to options context. avconv: move rate_emu to options context. avconv: move max_frames to options context. avconv: move metadata to options context. avconv: move ts scale to options context. avconv: move chapter maps to options context. avconv: move metadata maps to options context. avconv: move codec_names to options context. Conflicts: avconv.c tests/fate-run.sh Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpeg12.c')
-rw-r--r--libavcodec/mpeg12.c40
1 files changed, 19 insertions, 21 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index 069cd00..bff8619 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -1949,7 +1949,7 @@ static int slice_decode_thread(AVCodecContext *c, void *arg){
//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)
- return AVERROR_INVALIDDATA;
+ 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);
}else{
@@ -2303,10 +2303,11 @@ static int mpeg_decode_frame(AVCodecContext *avctx,
s->slice_count= 0;
- if(avctx->extradata && !avctx->frame_number &&
- decode_chunks(avctx, picture, data_size, avctx->extradata, avctx->extradata_size) < 0 &&
- avctx->error_recognition >= FF_ER_EXPLODE)
- return AVERROR_INVALIDDATA;
+ 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)
+ return ret;
+ }
return decode_chunks(avctx, picture, data_size, buf, buf_size);
}
@@ -2381,17 +2382,17 @@ static int decode_chunks(AVCodecContext *avctx,
s->slice_count = 0;
}
if(last_code == 0 || last_code == SLICE_MIN_START_CODE){
- if(mpeg_decode_postinit(avctx) < 0){
- av_log(avctx, AV_LOG_ERROR, "mpeg_decode_postinit() failure\n");
- return -1;
- }
+ ret = mpeg_decode_postinit(avctx);
+ if(ret < 0){
+ av_log(avctx, AV_LOG_ERROR, "mpeg_decode_postinit() failure\n");
+ return ret;
+ }
- /* we have a complete image: we try to decompress it */
- if(mpeg1_decode_picture(avctx,
- buf_ptr, input_size) < 0)
- s2->pict_type=0;
+ /* we have a complete image: we try to decompress it */
+ if (mpeg1_decode_picture(avctx, buf_ptr, input_size) < 0)
+ s2->pict_type=0;
s2->first_slice = 1;
- last_code= PICTURE_START_CODE;
+ 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)
@@ -2437,9 +2438,8 @@ static int decode_chunks(AVCodecContext *avctx,
break;
case GOP_START_CODE:
if(last_code == 0){
- s2->first_field=0;
- mpeg_decode_gop(avctx,
- buf_ptr, input_size);
+ s2->first_field=0;
+ mpeg_decode_gop(avctx, buf_ptr, input_size);
s->sync=1;
}else{
av_log(avctx, AV_LOG_ERROR, "ignoring GOP_START_CODE after %X\n", last_code);
@@ -2501,9 +2501,7 @@ static int decode_chunks(AVCodecContext *avctx,
}
if(!s2->current_picture_ptr){
av_log(avctx, AV_LOG_ERROR, "current_picture not initialized\n");
- if (avctx->error_recognition >= FF_ER_EXPLODE)
- return AVERROR_INVALIDDATA;
- return -1;
+ return AVERROR_INVALIDDATA;
}
if (uses_vdpau(avctx)) {
@@ -2533,7 +2531,7 @@ static int decode_chunks(AVCodecContext *avctx,
if(ret < 0){
if (avctx->error_recognition >= FF_ER_EXPLODE)
- return AVERROR_INVALIDDATA;
+ 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);
}else{
OpenPOWER on IntegriCloud