diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2009-03-02 14:53:18 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2009-03-02 14:53:18 +0000 |
commit | a4c7a5ea27050a28625eabf1ba98cfef9ac6620d (patch) | |
tree | d726c914a687295f52aa1e27913a50e019f2187f /libavcodec/mpegvideo_parser.c | |
parent | 873b092353f95a852e4f2f7639fc13bc8b81cb41 (diff) | |
download | ffmpeg-a4c7a5ea27050a28625eabf1ba98cfef9ac6620d.tar.gz |
Call ff_fetch_timestamp() for mpeg1/2 when a picture start code is found instead
of calling it at the end of a frame with a large negative offset.
This significantly reduces the maximal distance in container packets between
the point where the first byte of the "access unit" was stored and where
we call ff_fetch_timestamp() thus reducing the constraints on our parser.
Also change the parser from next_frame_offset to cur, this is needed
because now the reference is from container packet start instead of
frame start. (i previously misinterpreted this as bug)
Originally committed as revision 17731 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegvideo_parser.c')
-rw-r--r-- | libavcodec/mpegvideo_parser.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/libavcodec/mpegvideo_parser.c b/libavcodec/mpegvideo_parser.c index 2ccb9fff2c..215c86c400 100644 --- a/libavcodec/mpegvideo_parser.c +++ b/libavcodec/mpegvideo_parser.c @@ -29,7 +29,6 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s, { ParseContext1 *pc = s->priv_data; const uint8_t *buf_end; - const uint8_t *buf_start= buf; uint32_t start_code; int frame_rate_index, ext_type, bytes_left; int frame_rate_ext_n, frame_rate_ext_d; @@ -44,8 +43,6 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s, bytes_left = buf_end - buf; switch(start_code) { case PICTURE_START_CODE: - ff_fetch_timestamp(s, buf-buf_start-4, 1); - if (bytes_left >= 2) { s->pict_type = (buf[1] >> 3) & 7; } @@ -137,7 +134,7 @@ static int mpegvideo_parse(AVCodecParserContext *s, if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){ next= buf_size; }else{ - next= ff_mpeg1_find_frame_end(pc, buf, buf_size); + next= ff_mpeg1_find_frame_end(pc, buf, buf_size, s); if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) { *poutbuf = NULL; |