Mercurial > libavcodec.hg
diff h263dec.c @ 274:d0c186bcf075 libavcodec
use the width & height from the mpeg4 header ... in the case that its complete
author | michaelni |
---|---|
date | Tue, 19 Mar 2002 03:51:36 +0000 |
parents | 34f40a0fc840 |
children | 1fc96b02142e |
line wrap: on
line diff
--- a/h263dec.c Mon Mar 18 21:06:07 2002 +0000 +++ b/h263dec.c Tue Mar 19 03:51:36 2002 +0000 @@ -59,7 +59,7 @@ } /* for h263, we allocate the images after having read the header */ - if (avctx->codec->id != CODEC_ID_H263) + if (avctx->codec->id != CODEC_ID_H263 && avctx->codec->id != CODEC_ID_MPEG4) if (MPV_common_init(s) < 0) return -1; @@ -114,22 +114,24 @@ ret = intel_h263_decode_picture_header(s); } else { ret = h263_decode_picture_header(s); - /* After H263 header decode we have the height, width, */ + } + + /* After H263 & mpeg4 header decode we have the height, width,*/ /* and other parameters. So then we could init the picture */ /* FIXME: By the way H263 decoder is evolving it should have */ /* an H263EncContext */ - if (!s->context_initialized) { - avctx->width = s->width; - avctx->height = s->height; - if (MPV_common_init(s) < 0) - return -1; - } else if (s->width != avctx->width || s->height != avctx->height) { - /* H.263 could change picture size any time */ - MPV_common_end(s); - if (MPV_common_init(s) < 0) - return -1; - } + if (!s->context_initialized) { + avctx->width = s->width; + avctx->height = s->height; + if (MPV_common_init(s) < 0) + return -1; + } else if (s->width != avctx->width || s->height != avctx->height) { + /* H.263 could change picture size any time */ + MPV_common_end(s); + if (MPV_common_init(s) < 0) + return -1; } + if (ret < 0) return -1;