aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/parser.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2009-03-02 14:53:18 +0000
committerMichael Niedermayer <michaelni@gmx.at>2009-03-02 14:53:18 +0000
commita4c7a5ea27050a28625eabf1ba98cfef9ac6620d (patch)
treed726c914a687295f52aa1e27913a50e019f2187f /libavcodec/parser.c
parent873b092353f95a852e4f2f7639fc13bc8b81cb41 (diff)
downloadffmpeg-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/parser.c')
-rw-r--r--libavcodec/parser.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/parser.c b/libavcodec/parser.c
index d738a62b83..c0a0095309 100644
--- a/libavcodec/parser.c
+++ b/libavcodec/parser.c
@@ -87,7 +87,7 @@ void ff_fetch_timestamp(AVCodecParserContext *s, int off, int remove){
s->dts= s->pts= AV_NOPTS_VALUE;
s->offset= 0;
for(i = 0; i < AV_PARSER_PTS_NB; i++) {
- if ( s->next_frame_offset + off >= s->cur_frame_offset[i]
+ if ( s->cur_offset + off >= s->cur_frame_offset[i]
&&(s-> frame_offset < s->cur_frame_offset[i] || !s->frame_offset)
//check is disabled becausue mpeg-ts doesnt send complete PES packets
&& /*s->next_frame_offset + off <*/ s->cur_frame_end[i]){