comparison parser.c @ 2119:f8948ed6553a libavcodec

field pic timestamp fix
author michael
date Fri, 09 Jul 2004 21:55:10 +0000
parents bec4623c2201
children 872ac88d4e60
comparison
equal deleted inserted replaced
2118:b11c0bb3b71c 2119:f8948ed6553a
279 ParseContext1 *pc = s->priv_data; 279 ParseContext1 *pc = s->priv_data;
280 const uint8_t *buf_end; 280 const uint8_t *buf_end;
281 int32_t start_code; 281 int32_t start_code;
282 int frame_rate_index, ext_type, bytes_left; 282 int frame_rate_index, ext_type, bytes_left;
283 int frame_rate_ext_n, frame_rate_ext_d; 283 int frame_rate_ext_n, frame_rate_ext_d;
284 int top_field_first, repeat_first_field, progressive_frame; 284 int picture_structure, top_field_first, repeat_first_field, progressive_frame;
285 int horiz_size_ext, vert_size_ext; 285 int horiz_size_ext, vert_size_ext;
286 286
287 s->repeat_pict = 0; 287 s->repeat_pict = 0;
288 buf_end = buf + buf_size; 288 buf_end = buf + buf_size;
289 while (buf < buf_end) { 289 while (buf < buf_end) {
326 avctx->sub_id = 2; /* forces MPEG2 */ 326 avctx->sub_id = 2; /* forces MPEG2 */
327 } 327 }
328 break; 328 break;
329 case 0x8: /* picture coding extension */ 329 case 0x8: /* picture coding extension */
330 if (bytes_left >= 5) { 330 if (bytes_left >= 5) {
331 picture_structure = (buf[3]>>5)&3;
331 top_field_first = buf[3] & (1 << 7); 332 top_field_first = buf[3] & (1 << 7);
332 repeat_first_field = buf[3] & (1 << 1); 333 repeat_first_field = buf[3] & (1 << 1);
333 progressive_frame = buf[4] & (1 << 7); 334 progressive_frame = buf[4] & (1 << 7);
334 335
335 /* check if we must repeat the frame */ 336 /* check if we must repeat the frame */
341 s->repeat_pict = 2; 342 s->repeat_pict = 2;
342 } else if (progressive_frame) { 343 } else if (progressive_frame) {
343 s->repeat_pict = 1; 344 s->repeat_pict = 1;
344 } 345 }
345 } 346 }
347
348 /* the packet only represents half a frame
349 XXX,FIXME maybe find a different solution */
350 if(picture_structure != 3)
351 s->repeat_pict = -1;
346 } 352 }
347 break; 353 break;
348 } 354 }
349 } 355 }
350 break; 356 break;