comparison snow.c @ 9372:9bb96825fc10 libavcodec

Skip non intra frames that have no reference frames.
author michael
date Thu, 09 Apr 2009 20:13:35 +0000
parents 6de6fb68621c
children 78c2ddc32bed
comparison
equal deleted inserted replaced
9371:6de6fb68621c 9372:9bb96825fc10
4143 int i; 4143 int i;
4144 for(i=0; i<s->max_ref_frames && s->last_picture[i].data[0]; i++) 4144 for(i=0; i<s->max_ref_frames && s->last_picture[i].data[0]; i++)
4145 if(i && s->last_picture[i-1].key_frame) 4145 if(i && s->last_picture[i-1].key_frame)
4146 break; 4146 break;
4147 s->ref_frames= i; 4147 s->ref_frames= i;
4148 if(s->ref_frames==0){
4149 av_log(s->avctx,AV_LOG_ERROR, "No reference frames\n");
4150 return -1;
4151 }
4148 } 4152 }
4149 4153
4150 s->current_picture.reference= 1; 4154 s->current_picture.reference= 1;
4151 if(s->avctx->get_buffer(s->avctx, &s->current_picture) < 0){ 4155 if(s->avctx->get_buffer(s->avctx, &s->current_picture) < 0){
4152 av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n"); 4156 av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
4518 && p->hcoeff[2]==2; 4522 && p->hcoeff[2]==2;
4519 } 4523 }
4520 4524
4521 alloc_blocks(s); 4525 alloc_blocks(s);
4522 4526
4523 frame_start(s); 4527 if(frame_start(s) < 0)
4528 return -1;
4524 //keyframe flag duplication mess FIXME 4529 //keyframe flag duplication mess FIXME
4525 if(avctx->debug&FF_DEBUG_PICT_INFO) 4530 if(avctx->debug&FF_DEBUG_PICT_INFO)
4526 av_log(avctx, AV_LOG_ERROR, "keyframe:%d qlog:%d\n", s->keyframe, s->qlog); 4531 av_log(avctx, AV_LOG_ERROR, "keyframe:%d qlog:%d\n", s->keyframe, s->qlog);
4527 4532
4528 decode_blocks(s); 4533 decode_blocks(s);