# HG changeset patch # User michael # Date 1199495649 0 # Node ID c8b9b73b979f206a1c24fc08603950faffc64a9d # Parent 75804d49f33b0dfd43d97e95c92957159880e963 Drop non key frames before the first key frame. diff -r 75804d49f33b -r c8b9b73b979f mpeg12.c --- a/mpeg12.c Fri Jan 04 23:09:58 2008 +0000 +++ b/mpeg12.c Sat Jan 05 01:14:09 2008 +0000 @@ -2329,8 +2329,10 @@ if(s2->last_picture_ptr==NULL){ /* Skip B-frames if we do not have reference frames. */ if(s2->pict_type==B_TYPE) break; + } + if(s2->next_picture_ptr==NULL){ /* Skip P-frames if we do not have reference frame no valid header. */ -// if(s2->pict_type==P_TYPE && s2->first_field && !s2->first_slice) break; + if(s2->pict_type==P_TYPE && (s2->first_field || s2->picture_structure==PICT_FRAME)) break; } /* Skip B-frames if we are in a hurry. */ if(avctx->hurry_up && s2->pict_type==B_TYPE) break;