comparison h263dec.c @ 1393:ba99a78bcb37 libavcodec

make the h263 decoder more error tolerant
author michaelni
date Fri, 01 Aug 2003 11:00:03 +0000
parents da0b3a50d209
children ff0220970711
comparison
equal deleted inserted replaced
1392:13a02518ffb6 1393:ba99a78bcb37
468 } else if (s->h263_flv) { 468 } else if (s->h263_flv) {
469 ret = flv_h263_decode_picture_header(s); 469 ret = flv_h263_decode_picture_header(s);
470 } else { 470 } else {
471 ret = h263_decode_picture_header(s); 471 ret = h263_decode_picture_header(s);
472 } 472 }
473
474 if(ret==FRAME_SKIPED) return get_consumed_bytes(s, buf_size);
475
476 /* skip if the header was thrashed */
477 if (ret < 0){
478 fprintf(stderr, "header damaged\n");
479 return -1;
480 }
481
473 avctx->has_b_frames= !s->low_delay; 482 avctx->has_b_frames= !s->low_delay;
474 483
475 if(s->workaround_bugs&FF_BUG_AUTODETECT){ 484 if(s->workaround_bugs&FF_BUG_AUTODETECT){
476 if(s->padding_bug_score > -2 && !s->data_partitioning && !s->resync_marker) 485 if(s->padding_bug_score > -2 && !s->data_partitioning && !s->resync_marker)
477 s->workaround_bugs |= FF_BUG_NO_PADDING; 486 s->workaround_bugs |= FF_BUG_NO_PADDING;
602 goto retry; 611 goto retry;
603 } 612 }
604 613
605 if((s->codec_id==CODEC_ID_H263 || s->codec_id==CODEC_ID_H263P)) 614 if((s->codec_id==CODEC_ID_H263 || s->codec_id==CODEC_ID_H263P))
606 s->gob_index = ff_h263_get_gob_height(s); 615 s->gob_index = ff_h263_get_gob_height(s);
607
608 if(ret==FRAME_SKIPED) return get_consumed_bytes(s, buf_size);
609 /* skip if the header was thrashed */
610 if (ret < 0){
611 fprintf(stderr, "header damaged\n");
612 return -1;
613 }
614 616
615 // for hurry_up==5 617 // for hurry_up==5
616 s->current_picture.pict_type= s->pict_type; 618 s->current_picture.pict_type= s->pict_type;
617 s->current_picture.key_frame= s->pict_type == I_TYPE; 619 s->current_picture.key_frame= s->pict_type == I_TYPE;
618 620