diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-10-28 14:54:46 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-10-28 14:54:46 +0400 |
commit | d57a6fe6abdab934063b809e43096bf887d01696 (patch) | |
tree | 96870fe8697376c54185274de467cbd0fc5f1af3 /libavcodec/h263dec.c | |
parent | c985966a10599219bf52d21aebdf203d669c8c60 (diff) | |
parent | 0749314886390f6ec81d45e0ba424fcb36c945cf (diff) |
Merge commit '0749314886390f6ec81d45e0ba424fcb36c945cf'
* commit '0749314886390f6ec81d45e0ba424fcb36c945cf':
h263: Return meaningful errors
Conflicts:
libavcodec/h263dec.c
See: 7b62d3415e8e44618cb97775567d453295c4f4d9
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h263dec.c')
-rw-r--r-- | libavcodec/h263dec.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index 7db32e76de..e2fb199dd2 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -107,7 +107,9 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx) s->h263_flv = 1; break; default: - return AVERROR(EINVAL); + av_log(avctx, AV_LOG_ERROR, "Unsupported codec %d\n", + avctx->codec->id); + return AVERROR(ENOSYS); } s->codec_id = avctx->codec->id; avctx->hwaccel = ff_find_hwaccel(avctx->codec->id, avctx->pix_fmt); @@ -166,7 +168,8 @@ static int get_consumed_bytes(MpegEncContext *s, int buf_size) static int decode_slice(MpegEncContext *s) { - const int part_mask = s->partitioned_frame ? (ER_AC_END | ER_AC_ERROR) : 0x7F; + const int part_mask = s->partitioned_frame + ? (ER_AC_END | ER_AC_ERROR) : 0x7F; const int mb_size = 16 >> s->avctx->lowres; int ret; @@ -403,7 +406,7 @@ int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, } else { av_log(s->avctx, AV_LOG_ERROR, "this codec does not support truncated bitstreams\n"); - return AVERROR(EINVAL); + return AVERROR(ENOSYS); } if (ff_combine_frame(&s->parse_context, next, (const uint8_t **)&buf, @@ -435,7 +438,8 @@ retry: return ret; if (!s->context_initialized) - if ((ret = ff_MPV_common_init(s)) < 0) // we need the idct permutaton for reading a custom matrix + // we need the idct permutaton for reading a custom matrix + if ((ret = ff_MPV_common_init(s)) < 0) return ret; /* We need to set current_picture_ptr before reading the header, @@ -676,10 +680,12 @@ retry: goto frame_end; } - if (avctx->hwaccel) - if ((ret = avctx->hwaccel->start_frame(avctx, s->gb.buffer, - s->gb.buffer_end - s->gb.buffer)) < 0) + if (avctx->hwaccel) { + ret = avctx->hwaccel->start_frame(avctx, s->gb.buffer, + s->gb.buffer_end - s->gb.buffer); + if (ret < 0 ) return ret; + } ff_mpeg_er_frame_start(s); @@ -729,9 +735,11 @@ retry: frame_end: ff_er_frame_end(&s->er); - if (avctx->hwaccel) - if ((ret = avctx->hwaccel->end_frame(avctx)) < 0) + if (avctx->hwaccel) { + ret = avctx->hwaccel->end_frame(avctx); + if (ret < 0) return ret; + } ff_MPV_frame_end(s); |