diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2008-06-02 13:12:54 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2008-06-02 13:12:54 +0000 |
commit | ec0c5d482e6f0cc8c94980494cf6bad39419302c (patch) | |
tree | f933da209adb4cbdc5381c3d3a273b2383d382b2 | |
parent | 21e305891c63b04ffcad1721eea8fe92f265f7f7 (diff) | |
download | ffmpeg-ec0c5d482e6f0cc8c94980494cf6bad39419302c.tar.gz |
Allow matching timestamps to be removed by fetch_timestamp().
Originally committed as revision 13623 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/parser.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/parser.c b/libavcodec/parser.c index 2476093b57..0bc9091fe3 100644 --- a/libavcodec/parser.c +++ b/libavcodec/parser.c @@ -76,7 +76,7 @@ AVCodecParserContext *av_parser_init(int codec_id) return s; } -void ff_fetch_timestamp(AVCodecParserContext *s, int off){ +void ff_fetch_timestamp(AVCodecParserContext *s, int off, int remove){ int i; s->dts= s->pts= AV_NOPTS_VALUE; s->offset= 0; @@ -87,6 +87,8 @@ void ff_fetch_timestamp(AVCodecParserContext *s, int off){ s->dts= s->cur_frame_dts[i]; s->pts= s->cur_frame_pts[i]; s->offset = s->next_frame_offset - s->cur_frame_offset[i]; + if(remove) + s->cur_frame_offset[i]= INT64_MAX; } } } @@ -142,7 +144,7 @@ int av_parser_parse(AVCodecParserContext *s, s->fetch_timestamp=0; s->last_pts = s->pts; s->last_dts = s->dts; - ff_fetch_timestamp(s, 0); + ff_fetch_timestamp(s, 0, 0); } /* WARNING: the returned index can be negative */ |