comparison parser.c @ 9092:65f47b345904 libavcodec

Consider all packets in the parser, not just ones with timestamps, this should greatly simplify handling of packet pos.
author michael
date Mon, 02 Mar 2009 15:13:58 +0000
parents 4875c1559060
children 322fa07fd397
comparison
equal deleted inserted replaced
9091:4875c1559060 9092:65f47b345904
139 /* padding is always necessary even if EOF, so we add it here */ 139 /* padding is always necessary even if EOF, so we add it here */
140 memset(dummy_buf, 0, sizeof(dummy_buf)); 140 memset(dummy_buf, 0, sizeof(dummy_buf));
141 buf = dummy_buf; 141 buf = dummy_buf;
142 } else { 142 } else {
143 /* add a new packet descriptor */ 143 /* add a new packet descriptor */
144 if(pts != AV_NOPTS_VALUE || dts != AV_NOPTS_VALUE){
145 i = (s->cur_frame_start_index + 1) & (AV_PARSER_PTS_NB - 1); 144 i = (s->cur_frame_start_index + 1) & (AV_PARSER_PTS_NB - 1);
146 s->cur_frame_start_index = i; 145 s->cur_frame_start_index = i;
147 s->cur_frame_offset[i] = s->cur_offset; 146 s->cur_frame_offset[i] = s->cur_offset;
148 s->cur_frame_end[i] = s->cur_offset + buf_size; 147 s->cur_frame_end[i] = s->cur_offset + buf_size;
149 s->cur_frame_pts[i] = pts; 148 s->cur_frame_pts[i] = pts;
150 s->cur_frame_dts[i] = dts; 149 s->cur_frame_dts[i] = dts;
151 }
152 } 150 }
153 151
154 if (s->fetch_timestamp){ 152 if (s->fetch_timestamp){
155 s->fetch_timestamp=0; 153 s->fetch_timestamp=0;
156 s->last_pts = s->pts; 154 s->last_pts = s->pts;