diff options
author | Fabrice Bellard <fabrice@bellard.org> | 2003-11-10 18:33:58 +0000 |
---|---|---|
committer | Fabrice Bellard <fabrice@bellard.org> | 2003-11-10 18:33:58 +0000 |
commit | c6f353ff616fc58847eecef3b2e797c8c7795c1b (patch) | |
tree | ee6ffad499432edb41b9920f2dd9cfc8ffe8ea19 /libavcodec/parser.c | |
parent | 8424cf505c2b7bb6f26addcc3fe1e8dbfa17df1d (diff) | |
download | ffmpeg-c6f353ff616fc58847eecef3b2e797c8c7795c1b.tar.gz |
also parse extradata for MPEG4
Originally committed as revision 2493 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/parser.c')
-rw-r--r-- | libavcodec/parser.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libavcodec/parser.c b/libavcodec/parser.c index e332d7de17..d5333b6c90 100644 --- a/libavcodec/parser.c +++ b/libavcodec/parser.c @@ -114,8 +114,10 @@ typedef struct ParseContext1{ int frame_rate; int progressive_sequence; int width, height; + /* XXX: suppress that, needed by MPEG4 */ MpegEncContext *enc; + int first_picture; } ParseContext1; /** @@ -439,21 +441,31 @@ static int av_mpeg4_decode_header(AVCodecParserContext *s1, int ret; s->avctx = avctx; + s->current_picture_ptr = &s->current_picture; + + if (avctx->extradata_size && pc->first_picture){ + init_get_bits(gb, avctx->extradata, avctx->extradata_size*8); + ret = ff_mpeg4_decode_picture_header(s, gb); + } + init_get_bits(gb, buf, 8 * buf_size); ret = ff_mpeg4_decode_picture_header(s, gb); if (s->width) { avctx->width = s->width; avctx->height = s->height; } + pc->first_picture = 0; return ret; } int mpeg4video_parse_init(AVCodecParserContext *s) { ParseContext1 *pc = s->priv_data; + pc->enc = av_mallocz(sizeof(MpegEncContext)); if (!pc->enc) return -1; + pc->first_picture = 1; return 0; } |