comparison mpeg12.c @ 1672:1c9e8e499c56 libavcodec

fixed low delay decoding
author bellard
date Tue, 09 Dec 2003 14:51:49 +0000
parents 30746f429df6
children f17ba52fec08
comparison
equal deleted inserted replaced
1671:a75cbb4588d1 1672:1c9e8e499c56
2397 s->progressive_frame = 1; 2397 s->progressive_frame = 1;
2398 s->picture_structure = PICT_FRAME; 2398 s->picture_structure = PICT_FRAME;
2399 s->frame_pred_frame_dct = 1; 2399 s->frame_pred_frame_dct = 1;
2400 s->codec_id= s->avctx->codec_id= CODEC_ID_MPEG1VIDEO; 2400 s->codec_id= s->avctx->codec_id= CODEC_ID_MPEG1VIDEO;
2401 avctx->sub_id = 1; /* indicates mpeg1 */ 2401 avctx->sub_id = 1; /* indicates mpeg1 */
2402 if(s->flags & CODEC_FLAG_LOW_DELAY) s->low_delay=1;
2402 return 0; 2403 return 0;
2403 } 2404 }
2404 2405
2405 static int vcr2_init_sequence(AVCodecContext *avctx) 2406 static int vcr2_init_sequence(AVCodecContext *avctx)
2406 { 2407 {
2572 /* find start next code */ 2573 /* find start next code */
2573 start_code = find_start_code(&buf_ptr, buf_end); 2574 start_code = find_start_code(&buf_ptr, buf_end);
2574 if (start_code < 0){ 2575 if (start_code < 0){
2575 if(s2->pict_type != B_TYPE || avctx->hurry_up==0){ 2576 if(s2->pict_type != B_TYPE || avctx->hurry_up==0){
2576 if (slice_end(avctx, picture)) { 2577 if (slice_end(avctx, picture)) {
2577 if(s2->last_picture_ptr) //FIXME merge with the stuff in mpeg_decode_slice 2578 if(s2->last_picture_ptr || s2->low_delay) //FIXME merge with the stuff in mpeg_decode_slice
2578 *data_size = sizeof(AVPicture); 2579 *data_size = sizeof(AVPicture);
2579 } 2580 }
2580 } 2581 }
2581 return FFMAX(0, buf_ptr - buf - s2->parse_context.last_index); 2582 return FFMAX(0, buf_ptr - buf - s2->parse_context.last_index);
2582 } 2583 }