Mercurial > libavcodec.hg
comparison parser.c @ 6979:4257fdcf664e libavcodec
Rename last_frame_offset to next_frame_offset.
(it was and is the next not the last)
author | michael |
---|---|
date | Mon, 02 Jun 2008 03:10:00 +0000 |
parents | de032bcdeff9 |
children | ddbc1767b7cd |
comparison
equal
deleted
inserted
replaced
6978:9774d160f014 | 6979:4257fdcf664e |
---|---|
128 s->last_pts = s->pts; | 128 s->last_pts = s->pts; |
129 s->last_dts = s->dts; | 129 s->last_dts = s->dts; |
130 s->dts= s->pts= AV_NOPTS_VALUE; | 130 s->dts= s->pts= AV_NOPTS_VALUE; |
131 s->offset= 0; | 131 s->offset= 0; |
132 for(i = 0; i < AV_PARSER_PTS_NB; i++) { | 132 for(i = 0; i < AV_PARSER_PTS_NB; i++) { |
133 if ( s->last_frame_offset >= s->cur_frame_offset[i] | 133 if ( s->next_frame_offset >= s->cur_frame_offset[i] |
134 &&(s-> frame_offset < s->cur_frame_offset[i] || !s->frame_offset) | 134 &&(s-> frame_offset < s->cur_frame_offset[i] || !s->frame_offset) |
135 && s->last_frame_offset < s->cur_frame_end[i]){ | 135 && s->next_frame_offset < s->cur_frame_end[i]){ |
136 s->dts= s->cur_frame_dts[i]; | 136 s->dts= s->cur_frame_dts[i]; |
137 s->pts= s->cur_frame_pts[i]; | 137 s->pts= s->cur_frame_pts[i]; |
138 s->offset = s->last_frame_offset - s->cur_frame_offset[i]; | 138 s->offset = s->next_frame_offset - s->cur_frame_offset[i]; |
139 } | 139 } |
140 } | 140 } |
141 } | 141 } |
142 | 142 |
143 /* WARNING: the returned index can be negative */ | 143 /* WARNING: the returned index can be negative */ |
144 index = s->parser->parser_parse(s, avctx, (const uint8_t **)poutbuf, poutbuf_size, buf, buf_size); | 144 index = s->parser->parser_parse(s, avctx, (const uint8_t **)poutbuf, poutbuf_size, buf, buf_size); |
145 //av_log(NULL, AV_LOG_DEBUG, "parser: in:%"PRId64", %"PRId64", out:%"PRId64", %"PRId64", in:%d out:%d id:%d\n", pts, dts, s->last_pts, s->last_dts, buf_size, *poutbuf_size, avctx->codec_id); | 145 //av_log(NULL, AV_LOG_DEBUG, "parser: in:%"PRId64", %"PRId64", out:%"PRId64", %"PRId64", in:%d out:%d id:%d\n", pts, dts, s->last_pts, s->last_dts, buf_size, *poutbuf_size, avctx->codec_id); |
146 /* update the file pointer */ | 146 /* update the file pointer */ |
147 if (*poutbuf_size) { | 147 if (*poutbuf_size) { |
148 /* fill the data for the current frame */ | 148 /* fill the data for the current frame */ |
149 s->frame_offset = s->last_frame_offset; | 149 s->frame_offset = s->next_frame_offset; |
150 | 150 |
151 /* offset of the next frame */ | 151 /* offset of the next frame */ |
152 s->last_frame_offset = s->cur_offset + index; | 152 s->next_frame_offset = s->cur_offset + index; |
153 s->fetch_timestamp=1; | 153 s->fetch_timestamp=1; |
154 } | 154 } |
155 if (index < 0) | 155 if (index < 0) |
156 index = 0; | 156 index = 0; |
157 s->cur_offset += index; | 157 s->cur_offset += index; |