changeset 6109:c8b9b73b979f libavcodec

Drop non key frames before the first key frame.
author michael
date Sat, 05 Jan 2008 01:14:09 +0000
parents 75804d49f33b
children 356a3c897bd2
files mpeg12.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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;