Mercurial > libavcodec.hg
diff parser.c @ 2837:45ccf6842c34 libavcodec
parse pict_type for streams in avi
fix mpeg4 parser so it outputs te pict_type
support header only parseing without repacking
author | michael |
---|---|
date | Mon, 15 Aug 2005 15:58:21 +0000 |
parents | 09108466b7d0 |
children | 40765c51a7a9 |
line wrap: on
line diff
--- a/parser.c Sun Aug 14 18:39:59 2005 +0000 +++ b/parser.c Mon Aug 15 15:58:21 2005 +0000 @@ -429,13 +429,18 @@ ParseContext1 *pc1 = s->priv_data; ParseContext *pc= &pc1->pc; int next; - - next= ff_mpeg1_find_frame_end(pc, buf, buf_size); - - if (ff_combine_frame(pc, next, (uint8_t **)&buf, &buf_size) < 0) { - *poutbuf = NULL; - *poutbuf_size = 0; - return buf_size; + + if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){ + next= buf_size; + }else{ + next= ff_mpeg1_find_frame_end(pc, buf, buf_size); + + if (ff_combine_frame(pc, next, (uint8_t **)&buf, &buf_size) < 0) { + *poutbuf = NULL; + *poutbuf_size = 0; + return buf_size; + } + } /* we have a full frame : we just parse the first few MPEG headers to have the full timing information. The time take by this @@ -506,6 +511,7 @@ if (s->width) { avcodec_set_dimensions(avctx, s->width, s->height); } + s1->pict_type= s->pict_type; pc->first_picture = 0; return ret; } @@ -529,12 +535,16 @@ ParseContext *pc = s->priv_data; int next; - next= ff_mpeg4_find_frame_end(pc, buf, buf_size); - - if (ff_combine_frame(pc, next, (uint8_t **)&buf, &buf_size) < 0) { - *poutbuf = NULL; - *poutbuf_size = 0; - return buf_size; + if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){ + next= buf_size; + }else{ + next= ff_mpeg4_find_frame_end(pc, buf, buf_size); + + if (ff_combine_frame(pc, next, (uint8_t **)&buf, &buf_size) < 0) { + *poutbuf = NULL; + *poutbuf_size = 0; + return buf_size; + } } av_mpeg4_decode_header(s, avctx, buf, buf_size);