summaryrefslogtreecommitdiff
path: root/libavcodec/parser.c
diff options
context:
space:
mode:
authorJoakim Plate <elupus@ecce.se>2007-04-13 07:50:04 +0000
committerBenoit Fouet <benoit.fouet@free.fr>2007-04-13 07:50:04 +0000
commita74008a4c3b23707e610db0b2f042c2c8347b08f (patch)
treea558adf1257e89c36b0d64864dd9ff19490e9c46 /libavcodec/parser.c
parent946d3b12a14ba661a2cdeaa1e85af224310b5753 (diff)
timestamps generation improvement when parsing avi
patch by Joakim \ elupus chez ecce dot se / original thread: date: 03/19/2007 01:47 AM subject: [Ffmpeg-devel] [RFC] Improvement for the odd timestamp generation when parser is in use. Originally committed as revision 8725 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/parser.c')
-rw-r--r--libavcodec/parser.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/parser.c b/libavcodec/parser.c
index d5b1bf1689..1c21d50fe5 100644
--- a/libavcodec/parser.c
+++ b/libavcodec/parser.c
@@ -124,6 +124,7 @@ int av_parser_parse(AVCodecParserContext *s,
s->fetch_timestamp=0;
s->last_pts = pts;
s->last_dts = dts;
+ s->last_offset = 0;
s->cur_frame_pts[k] =
s->cur_frame_dts[k] = AV_NOPTS_VALUE;
}
@@ -138,6 +139,7 @@ int av_parser_parse(AVCodecParserContext *s,
s->frame_offset = s->last_frame_offset;
s->pts = s->last_pts;
s->dts = s->last_dts;
+ s->offset = s->last_offset;
/* offset of the next frame */
s->last_frame_offset = s->cur_offset + index;
@@ -156,6 +158,7 @@ int av_parser_parse(AVCodecParserContext *s,
s->last_pts = s->cur_frame_pts[k];
s->last_dts = s->cur_frame_dts[k];
+ s->last_offset = s->last_frame_offset - s->cur_frame_offset[k];
/* some parsers tell us the packet size even before seeing the first byte of the next packet,
so the next pts/dts is in the next chunk */