|
|
@ -93,14 +93,16 @@ err_out: |
|
|
|
return NULL; |
|
|
|
return NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void ff_fetch_timestamp(AVCodecParserContext *s, int off, int remove) |
|
|
|
void ff_fetch_timestamp(AVCodecParserContext *s, int off, int remove, int fuzzy) |
|
|
|
{ |
|
|
|
{ |
|
|
|
int i; |
|
|
|
int i; |
|
|
|
|
|
|
|
|
|
|
|
s->dts = |
|
|
|
if (!fuzzy) { |
|
|
|
s->pts = AV_NOPTS_VALUE; |
|
|
|
s->dts = |
|
|
|
s->pos = -1; |
|
|
|
s->pts = AV_NOPTS_VALUE; |
|
|
|
s->offset = 0; |
|
|
|
s->pos = -1; |
|
|
|
|
|
|
|
s->offset = 0; |
|
|
|
|
|
|
|
} |
|
|
|
for (i = 0; i < AV_PARSER_PTS_NB; i++) { |
|
|
|
for (i = 0; i < AV_PARSER_PTS_NB; i++) { |
|
|
|
if (s->cur_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 < s->cur_frame_offset[i] || |
|
|
@ -108,10 +110,12 @@ void ff_fetch_timestamp(AVCodecParserContext *s, int off, int remove) |
|
|
|
// check disabled since MPEG-TS does not send complete PES packets
|
|
|
|
// check disabled since MPEG-TS does not send complete PES packets
|
|
|
|
/*s->next_frame_offset + off <*/ s->cur_frame_end[i]){ |
|
|
|
/*s->next_frame_offset + off <*/ s->cur_frame_end[i]){ |
|
|
|
|
|
|
|
|
|
|
|
s->dts = s->cur_frame_dts[i]; |
|
|
|
if (!fuzzy || s->cur_frame_dts[i] != AV_NOPTS_VALUE) { |
|
|
|
s->pts = s->cur_frame_pts[i]; |
|
|
|
s->dts = s->cur_frame_dts[i]; |
|
|
|
s->pos = s->cur_frame_pos[i]; |
|
|
|
s->pts = s->cur_frame_pts[i]; |
|
|
|
s->offset = s->next_frame_offset - s->cur_frame_offset[i]; |
|
|
|
s->pos = s->cur_frame_pos[i]; |
|
|
|
|
|
|
|
s->offset = s->next_frame_offset - s->cur_frame_offset[i]; |
|
|
|
|
|
|
|
} |
|
|
|
if (remove) |
|
|
|
if (remove) |
|
|
|
s->cur_frame_offset[i] = INT64_MAX; |
|
|
|
s->cur_frame_offset[i] = INT64_MAX; |
|
|
|
if (s->cur_offset + off < s->cur_frame_end[i]) |
|
|
|
if (s->cur_offset + off < s->cur_frame_end[i]) |
|
|
@ -154,7 +158,7 @@ int av_parser_parse2(AVCodecParserContext *s, AVCodecContext *avctx, |
|
|
|
s->last_pts = s->pts; |
|
|
|
s->last_pts = s->pts; |
|
|
|
s->last_dts = s->dts; |
|
|
|
s->last_dts = s->dts; |
|
|
|
s->last_pos = s->pos; |
|
|
|
s->last_pos = s->pos; |
|
|
|
ff_fetch_timestamp(s, 0, 0); |
|
|
|
ff_fetch_timestamp(s, 0, 0, 0); |
|
|
|
} |
|
|
|
} |
|
|
|
/* WARNING: the returned index can be negative */ |
|
|
|
/* WARNING: the returned index can be negative */ |
|
|
|
index = s->parser->parser_parse(s, avctx, (const uint8_t **) poutbuf, |
|
|
|
index = s->parser->parser_parse(s, avctx, (const uint8_t **) poutbuf, |
|
|
|