MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / ff_fetch_timestamp

Function ff_fetch_timestamp

libavcodec/parser.c:93–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93void ff_fetch_timestamp(AVCodecParserContext *s, int off, int remove, int fuzzy)
94{
95 int i;
96
97 if (!fuzzy) {
98 s->dts =
99 s->pts = AV_NOPTS_VALUE;
100 s->pos = -1;
101 s->offset = 0;
102 }
103 for (i = 0; i < AV_PARSER_PTS_NB; i++) {
104 if (s->cur_offset + off >= s->cur_frame_offset[i] &&
105 (s->frame_offset < s->cur_frame_offset[i] ||
106 (!s->frame_offset && !s->next_frame_offset)) && // first field/frame
107 // check disabled since MPEG-TS does not send complete PES packets
108 /*s->next_frame_offset + off <*/ s->cur_frame_end[i]){
109
110 if (!fuzzy || s->cur_frame_dts[i] != AV_NOPTS_VALUE) {
111 s->dts = s->cur_frame_dts[i];
112 s->pts = s->cur_frame_pts[i];
113 s->pos = s->cur_frame_pos[i];
114 s->offset = s->next_frame_offset - s->cur_frame_offset[i];
115 }
116 if (remove)
117 s->cur_frame_offset[i] = INT64_MAX;
118 if (s->cur_offset + off < s->cur_frame_end[i])
119 break;
120 }
121 }
122}
123
124int av_parser_parse2(AVCodecParserContext *s, AVCodecContext *avctx,
125 uint8_t **poutbuf, int *poutbuf_size,

Callers 2

av_parser_parse2Function · 0.85
mpeg1_find_frame_endFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected