# HG changeset patch # User michaelni # Date 1039040184 0 # Node ID eb448df811be44b1b17f3bbac5f1e25ddf07054e # Parent 8ae1e4c24e91cb9acf06fc575a8a5c25e8ffd032 fixing files where the first frame isn a keyframe diff -r 8ae1e4c24e91 -r eb448df811be mpegvideo.c --- a/mpegvideo.c Wed Dec 04 21:13:02 2002 +0000 +++ b/mpegvideo.c Wed Dec 04 22:16:24 2002 +0000 @@ -801,8 +801,8 @@ } } } - - if(!s->encoding){ +alloc: + if(!s->encoding){ /* find unused Picture */ for(i=0; ipicture[i].data[0]==NULL) break; @@ -829,14 +829,20 @@ s->current_picture= s->picture[i]; } - s->hurry_up= s->avctx->hurry_up; - s->error_resilience= avctx->error_resilience; - if (s->pict_type != B_TYPE) { s->last_picture= s->next_picture; s->next_picture= s->current_picture; } + + if(s->pict_type != I_TYPE && s->last_picture.data[0]==NULL){ + fprintf(stderr, "warning: first frame is no keyframe\n"); + assert(s->pict_type != B_TYPE); //these should have been dropped if we dont have a reference + goto alloc; + } + s->hurry_up= s->avctx->hurry_up; + s->error_resilience= avctx->error_resilience; + /* set dequantizer, we cant do it during init as it might change for mpeg4 and we cant do it in the header decode as init isnt called for mpeg4 there yet */ if(s->out_format == FMT_H263){