Mercurial > libavcodec.hg
changeset 10589:02c7c0a5ad7d libavcodec
Move mpeg_decode_postinit() out of bitstream decoding functions, it does not
belong in there.
author | michael |
---|---|
date | Sat, 28 Nov 2009 21:32:33 +0000 |
parents | 96b9deb2adb1 |
children | 0c6e62729784 |
files | mpeg12.c |
diffstat | 1 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mpeg12.c Sat Nov 28 18:57:12 2009 +0000 +++ b/mpeg12.c Sat Nov 28 21:32:33 2009 +0000 @@ -1352,9 +1352,6 @@ MpegEncContext *s = &s1->mpeg_enc_ctx; int ref, f_code, vbv_delay; - if(mpeg_decode_postinit(s->avctx) < 0) - return -2; - init_get_bits(&s->gb, buf, buf_size*8); ref = get_bits(&s->gb, 10); /* temporal ref */ @@ -2304,6 +2301,11 @@ break; case PICTURE_START_CODE: + if(mpeg_decode_postinit(avctx) < 0){ + av_log(avctx, AV_LOG_ERROR, "mpeg_decode_postinit() failure\n"); + return -1; + } + /* we have a complete image: we try to decompress it */ if(mpeg1_decode_picture(avctx, buf_ptr, input_size) < 0)