Commit ec0c5d48 authored by Michael Niedermayer's avatar Michael Niedermayer

Allow matching timestamps to be removed by fetch_timestamp().

Originally committed as revision 13623 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 21e30589
...@@ -76,7 +76,7 @@ AVCodecParserContext *av_parser_init(int codec_id) ...@@ -76,7 +76,7 @@ AVCodecParserContext *av_parser_init(int codec_id)
return s; return s;
} }
void ff_fetch_timestamp(AVCodecParserContext *s, int off){ void ff_fetch_timestamp(AVCodecParserContext *s, int off, int remove){
int i; int i;
s->dts= s->pts= AV_NOPTS_VALUE; s->dts= s->pts= AV_NOPTS_VALUE;
s->offset= 0; s->offset= 0;
...@@ -87,6 +87,8 @@ void ff_fetch_timestamp(AVCodecParserContext *s, int off){ ...@@ -87,6 +87,8 @@ void ff_fetch_timestamp(AVCodecParserContext *s, int off){
s->dts= s->cur_frame_dts[i]; s->dts= s->cur_frame_dts[i];
s->pts= s->cur_frame_pts[i]; s->pts= s->cur_frame_pts[i];
s->offset = s->next_frame_offset - s->cur_frame_offset[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, ...@@ -142,7 +144,7 @@ int av_parser_parse(AVCodecParserContext *s,
s->fetch_timestamp=0; s->fetch_timestamp=0;
s->last_pts = s->pts; s->last_pts = s->pts;
s->last_dts = s->dts; s->last_dts = s->dts;
ff_fetch_timestamp(s, 0); ff_fetch_timestamp(s, 0, 0);
} }
/* WARNING: the returned index can be negative */ /* WARNING: the returned index can be negative */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment