From: Michael Niedermayer <[email protected]>
Signed-off-by: Vittorio Giovara <[email protected]>
---
libavcodec/mpeg12dec.c | 44 ++++++++++++++++++++++++--------------------
1 file changed, 24 insertions(+), 20 deletions(-)
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index 0fc1790..8aa23dc 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -711,6 +711,7 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t
block[12][64])
{
int i, j, k, cbp, val, mb_type, motion_type;
const int mb_block_count = 4 + (1 << s->chroma_format);
+ int ret;
av_dlog(s->avctx, "decode_mb: x=%d y=%d\n", s->mb_x, s->mb_y);
@@ -827,13 +828,13 @@ FF_ENABLE_DEPRECATION_WARNINGS
mpeg2_fast_decode_block_intra(s, *s->pblocks[i], i);
} else {
for (i = 0; i < mb_block_count; i++)
- if (mpeg2_decode_block_intra(s, *s->pblocks[i], i) < 0)
- return -1;
+ if ((ret = mpeg2_decode_block_intra(s, *s->pblocks[i], i))
< 0)
+ return ret;
}
} else {
for (i = 0; i < 6; i++)
- if (mpeg1_decode_block_intra(s, *s->pblocks[i], i) < 0)
- return -1;
+ if ((ret = mpeg1_decode_block_intra(s, *s->pblocks[i], i)) < 0)
+ return ret;
}
} else {
if (mb_type & MB_TYPE_ZERO_MV) {
@@ -1053,8 +1054,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
for (i = 0; i < mb_block_count; i++) {
if (cbp & (1 << 11)) {
- if (mpeg2_decode_block_non_intra(s,
*s->pblocks[i], i) < 0)
- return -1;
+ if ((ret = mpeg2_decode_block_non_intra(s,
*s->pblocks[i], i)) < 0)
+ return ret;
} else {
s->block_last_index[i] = -1;
}
@@ -1073,8 +1074,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
} else {
for (i = 0; i < 6; i++) {
if (cbp & 32) {
- if (mpeg1_decode_block_inter(s, *s->pblocks[i], i)
< 0)
- return -1;
+ if ((ret = mpeg1_decode_block_inter(s,
*s->pblocks[i], i)) < 0)
+ return ret;
} else {
s->block_last_index[i] = -1;
}
@@ -1327,8 +1328,8 @@ static int mpeg_decode_postinit(AVCodecContext *avctx)
memcpy(old_permutation, s->idsp.idct_permutation, 64 *
sizeof(uint8_t));
ff_mpv_idct_init(s);
- if (ff_mpv_common_init(s) < 0)
- return -2;
+ if ((ret = ff_mpv_common_init(s)) < 0)
+ return ret;
quant_matrix_rebuild(s->intra_matrix, old_permutation,
s->idsp.idct_permutation);
quant_matrix_rebuild(s->inter_matrix, old_permutation,
s->idsp.idct_permutation);
@@ -1600,13 +1601,14 @@ static int mpeg_field_start(MpegEncContext *s, const
uint8_t *buf, int buf_size)
{
AVCodecContext *avctx = s->avctx;
Mpeg1Context *s1 = (Mpeg1Context *) s;
+ int ret;
/* start frame decoding */
if (s->first_field || s->picture_structure == PICT_FRAME) {
AVFrameSideData *pan_scan;
- if (ff_mpv_frame_start(s, avctx) < 0)
- return -1;
+ if ((ret = ff_mpv_frame_start(s, avctx)) < 0)
+ return ret;
ff_mpeg_er_frame_start(s);
@@ -1685,8 +1687,8 @@ static int mpeg_field_start(MpegEncContext *s, const
uint8_t *buf, int buf_size)
}
if (avctx->hwaccel) {
- if (avctx->hwaccel->start_frame(avctx, buf, buf_size) < 0)
- return -1;
+ if ((ret = avctx->hwaccel->start_frame(avctx, buf, buf_size)) < 0)
+ return ret;
}
#if FF_API_XVMC
@@ -1716,6 +1718,7 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y,
{
AVCodecContext *avctx = s->avctx;
const int field_pic = s->picture_structure != PICT_FRAME;
+ int ret;
s->resync_mb_x =
s->resync_mb_y = -1;
@@ -1814,8 +1817,8 @@ FF_DISABLE_DEPRECATION_WARNINGS
FF_ENABLE_DEPRECATION_WARNINGS
#endif /* FF_API_XVMC */
- if (mpeg_decode_mb(s, s->block) < 0)
- return -1;
+ if ((ret = mpeg_decode_mb(s, s->block)) < 0)
+ return ret;
// Note motion_val is normally NULL unless we want to extract the MVs.
if (s->current_picture.motion_val[0] && !s->encoding) {
@@ -2148,6 +2151,7 @@ static int vcr2_init_sequence(AVCodecContext *avctx)
Mpeg1Context *s1 = avctx->priv_data;
MpegEncContext *s = &s1->mpeg_enc_ctx;
int i, v;
+ int ret;
/* start new MPEG-1 context decoding */
s->out_format = FMT_MPEG1;
@@ -2170,8 +2174,8 @@ static int vcr2_init_sequence(AVCodecContext *avctx)
avctx->idct_algo = FF_IDCT_SIMPLE;
ff_mpv_idct_init(s);
- if (ff_mpv_common_init(s) < 0)
- return -1;
+ if ((ret = ff_mpv_common_init(s)) < 0)
+ return ret;
s1->mpeg_enc_ctx_allocated = 1;
for (i = 0; i < 64; i++) {
@@ -2555,8 +2559,8 @@ static int decode_chunks(AVCodecContext *avctx, AVFrame
*picture,
if (s->first_slice) {
skip_frame = 0;
s->first_slice = 0;
- if (mpeg_field_start(s2, buf, buf_size) < 0)
- return -1;
+ if ((ret = mpeg_field_start(s2, buf, buf_size)) < 0)
+ return ret;
}
if (!s2->current_picture_ptr) {
av_log(avctx, AV_LOG_ERROR,
--
1.9.3 (Apple Git-50)
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel